Cinder icon indicating copy to clipboard operation
Cinder copied to clipboard

Tumbling does not work after setting camera to straight down and setting orientation.

Open chamric opened this issue 6 years ago • 2 comments

I used a combination of the camera's setEyePoint(), setOrientation(), and setPivotDistance() methods to initialize an overhead view of my scene with a desired orientation about the global Y. When I tried to tumble off of the initial point, there was an issue on line 223 of CameraUI.cpp.

There is a cross product between the view direction point and world up. The vectors are parallel, so the cross product is undefined, giving a NaN in the mU variable. The view was lost from this point forward.

chamric avatar Jan 17 '19 21:01 chamric

Does setting worldUp help as described in #1965?

gaborpapp avatar Jan 17 '19 21:01 gaborpapp

I also ran into this bug.

Steps to reproduce:

  1. Set mCam->lookAt(vec3(0,200,0), vec3(0,0,0)); so that the eyePoint is only y=200.
  2. Try to drag with left button to trigger tumble.

Expected Result: tumbling happens normally Actual Result: camera is rotated to NaN. In other words, eyePoint becomes vec3(-nan,-nan,-nan) at https://github.com/cinder/Cinder/blob/master/src/cinder/CameraUi.cpp#L223

shehabattia96 avatar Mar 30 '21 08:03 shehabattia96