artcom / react-three-arjs

AR.js with react-three-fiber
174 stars 43 forks source link

Render model without resizing according to marker. #12

Open HarshDivecha opened 2 years ago

HarshDivecha commented 2 years ago

I want to load the model in a way that it isn't resize according to the marker. How can i do that ? When i open a marker on my tab, it's huge, resulting in model to render twice the size and out of canvas.

j-era commented 2 years ago

Hi @HarshDivecha, the model size is always relative to the marker size in the camera view. If you want to change the relative size you could provide an additional parameter size (see https://ar-js-org.github.io/AR.js-Docs/marker-based/) e.g.:

<ARMarker params={{size: 2, ...}} ... >
HarshDivecha commented 2 years ago

@j-era any tips on how to stabilize the model on the marker ? it keeps moving in the opposite direction of the camera on the marker. Let's say if i am travelling to the right of camera the model is moving towards left and vice versa.

j-era commented 2 years ago

@j-era any tips on how to stabilize the model on the marker ? it keeps moving in the opposite direction of the camera on the marker. Let's say if i am travelling to the right of camera the model is moving towards left and vice versa.

Try with changing the smooth options, maybe you have a high smoothcount number? You can compare your results with the defaults here: https://github.com/artcom/react-three-arjs#demo This lib is all based on ar.js/artoolkit5. Questions concerning optimizations should be asked here https://github.com/AR-js-org/AR.js