I want to implement a camera like Meshlab tool or vtkInteractorStyleTrackballCamera,
I tried Arc Rotate Camera, but It can not rotate to some specific angle, like “look from left side”.
Hi @liuzhongshu ! Welcome to babylon.js!
ArcRotateCamera can rotate to any angle.
Try to set the limits to null:
camera.lowerAlphaLimit = null
camera.upperAlphaLimit = null
camera.lowerBetaLimit = null
camera.upperBetaLimit = null
camera.lowerRadiusLimit = 1
camera.upperRadiusLimit = 100
You can manipulate the camera using alpha, beta and radius or set the position and the target of the camera (in this case call camera.rebuildAnglesAndRadius() to sync the values).
You can achieve this by setting the upVector: https://playground.babylonjs.com/#VV935G#103
Thanks. but can i get this view using mouse or keyboard? user can not set camera using code. In Meshlab or vtk, user can get any view just using mouse.
When viewing both tools for the first time, I created an example PG based on a rotating video on YouTube.
meshlab : https://www.youtube.com/watch?v=gWBm5XGRJOk
PG : https://playground.babylonjs.com/#VV935G#104
vtk : https://www.youtube.com/watch?v=-Yiy_h7sT1s
PG : https://playground.babylonjs.com/#VV935G#106
Probably can be done with custom inputs.
This PG might also be helpful: https://playground.babylonjs.com/#GB1AW7#20
The last PG is very useful. Thanks very much, and I personally think this should be default behaviour for attched ArcRotateCamera.
But there is a diffrence, for vtk, the roation is on the camera instead of the model.
