Jump to content

Is this a bug with Gizmos? Reproduced in PG


Zephos
 Share

Recommended Posts

Hi all,

I have been having loads of fun with the new gizmos, but I discovered something very interesting. The position gizmo scales with distance from the camera, but that mechanism breaks when the camera has a parent it seems. I think it must be using the local position instead of the global position.

Here is the PG: https://www.babylonjs-playground.com/#31M2AP#35

Just press any key to move the camera's parent and see how the gizmo fails to scale properly, and if you move it around it scale erratically. Also, if you start the camera with a different position vector it effects the scale too, to the point where a vector of 0,0,0 makes it disappear.

Anyway, please let me know if this isn't a bug or if there is a work around. Thanks!

Link to comment
Share on other sites

Thanks yeah..  ! Happens more frequently when you do a jerk motion, though not sure about the scaling, I found it helpful when it scales bigger than sphere for distant 'z' positions, kindda gives me option to roll back.  

 

 

Link to comment
Share on other sites

4 minutes ago, ssaket said:

Thanks yeah..  ! Happens more frequently when you do a jerk motion, though not sure about the scaling, I found it helpful when it scales bigger than sphere for distant 'z' positions, kindda gives me option to roll back.  

 

 

Hmm... I don't notice any difference when I do jerk movements. As you move the camera back, the gizmo axis should stay the same size in the view though, but they are not. That is the issue I was talking about.

Link to comment
Share on other sites

Don't know anything about gizmos or how they work but setting a parent to the camera definitely affects how they behave. Here is a PG with parent to camera removed and the camera position changed directly https://www.babylonjs-playground.com/#31M2AP#36

When you use the console to log camera.position - in your version (#35) camera.position always logs the same value as it is set relative to parent. In my version (#36) the z value increments with the camera. So it seems that the gizmo manager uses the value given by camera position in its calculations whereas the rendering process takes into account the actual world position of the camera.

Link to comment
Share on other sites

20 hours ago, JohnK said:

Don't know anything about gizmos or how they work but setting a parent to the camera definitely affects how they behave. Here is a PG with parent to camera removed and the camera position changed directly https://www.babylonjs-playground.com/#31M2AP#36

When you use the console to log camera.position - in your version (#35) camera.position always logs the same value as it is set relative to parent. In my version (#36) the z value increments with the camera. So it seems that the gizmo manager uses the value given by camera position in its calculations whereas the rendering process takes into account the actual world position of the camera.

I guess the question now is whether this is the desired behavior or not. I bet it's an easy fix if not, as you can just use the global position of the camera in place of the values its using. Hopefully we can get Deltakosh or someone else who can change the source code to see this and take a look.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...