-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewpoint: centerOfRotation shifted in a strange way #20
Comments
Indeed, we don't support I'll fix it, this way:
I am currently in the middle of camera refactor in the engine ( https://castle-engine.io/wp/2019/09/14/big-improvements-to-camera-api-coming-soon-and-check-out-our-game-on-nintendo-switch/ ). After that refactor, I'll handle this task (as |
Hi Michalis, thanks for your answer! -- Meanwhile I have tested with:
and using an EventListener instead of a ProximitySensor with ROUTEs:
I also tested setting a suitable boundin box via bboxSize="40 40 40" in a surrounding Transform or Group node, but that didn't work either -- bboxSize seems to be ignored. A new field like forceCenterOfRotation would confuse the above mentioned X3D players and I want my scenes to work in all those viewers! Adding a fully transparent cube does work (see attached files), but
With best regards, Elmar P.S.: here are the test files: view3dscene_issue_20-1.zip |
That's a fair point. On the other hand, I really want the scenes where the author didn't bother to set correct Possibly the sensible solution is to use I will test this. As for As for extending "Print Current Camera..." output: sure, I'll do it too. |
Hi Michalis, sorry for the late answer! -- I think the 'sensible solution' is probably the best. It stays within the X3D specification, but also works for files where centerOfRotation was not explicitly set. So, go ahead and implement it... ;) Best regards, Elmar |
I see this old ticket is practically identical to the point 2 ("weird center of rotation") of the issue #46 . In the end, right now I implemented handling of
Hm. Let me experiment and maybe change my mind :) |
Done, and tested. We now use |
…patible with X3D standard) This is somewhat a followup to castle-engine/castle-model-viewer#20 , that made us honor centerOfRotation from X3D.
FYI, I added to view3dscene and CGE a new field Reason: I needed a way to say "this viewpoint doesn't contain useful centerOfRotation, calculate one looking at bounding box". For example when converting MD3 or glTF models to X3D -- MD3 or glTF have some cameras (so they are converted to viewpoint nodes) bu they don't have any useful "center of rotation" provided. Trying to use default (zero) resulted in weird "Examine" behavior for some of them, when the zero point was far from model's visible shape. So we need to restore old behavior for them, and say "ignore This shouldn't change anything for you, I'm just letting here know. By default when reading X3D file, |
Hi Michalis, thanks for the information! I've tested with latest View3DScene from 12-May-2023 23:03.
I see -- it is not yet compiled into the executable. But anyway, its default is FALSE, so it should have no effect on my files. In the unlikely case, that I discover an effect of With best regards, Elmar |
Hi Michalis,
while testing some of my X3D files I came across a problem with the Viewpoint node:
centerOfRotation seems to get altered by some internal View3DScene mechanism under certain conditions (even when there is no explicit Viewpoint given in the X3D file)!
Here is a simple example:
Try to rotate the cube and you'll see what I mean ...
My best guess: some automatic scene centering mechanism tries to compensate the movement of the Text node (which makes the scene somewhat 'a-symetrical').
I can correct this behavior partially by adding a big (size="40 40 40") fully transparent cube to the scene, but that's not really a good solution.
BTW.: When I try to print out the Viewpoint settings with "Clipboard -> Print Current Camera...", I only get position and orientation but not centerOfRotation and fieldOfView, which are essential to re-create the exact view!
So please:
With best regards,
Elmar
P.S.: here is the the test file: view3dscene_issue_20.zip
The text was updated successfully, but these errors were encountered: