osgjs icon indicating copy to clipboard operation
osgjs copied to clipboard

FirstPersonManipulator does not compute home position as expected.

Open jtorresfabra opened this issue 7 years ago • 2 comments

Pressing space bar when using FPS should get always the same position.

To reproduce you can try in the new sound-3D example. Move around and press space bar.

jtorresfabra avatar Oct 11 '16 13:10 jtorresfabra

Hmm computeHomePosition works the same way as the orbitManipulator. It keeps the rotation but simply translate the eye at the right distance (from the bounding sphere/box).

It's more intuitive with orbitManipulator; e.g, if you see a model from behind, computeHomePosition will simply zoom out and won't screw your rotation.

There could be 2 functions, one that always returns the same camera, and one that would be consistent (override position/rotation). I don't really have strong opinion on it.

@cedricpinson

stephomi avatar Oct 11 '16 14:10 stephomi

In CADManipulator I implemented the setHomePosition method (https://github.com/cedricpinson/osgjs/blob/master/sources/osgGA/CADManipulator.js#L192), which also exists in OSG.

When computing home position I was expecting the "home" to be always the same, and also you can set it from outside, which I believe is the behaviour in OSG.

Also maybe manipulators are needing a revamp. So I leave this issue for the record.

jtorresfabra avatar Oct 11 '16 14:10 jtorresfabra