Jump to content
  • Advertisement
Sign in to follow this  
Finalspace

How do i solve this specific scene graph problem

This topic is 882 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
 
i have a 2D scene graph.
 
i have object A, object B and transform V.
 
A is a sphere
B is a quad
 
Each object has a radius, either one or two dimension
The radius of each object A and B is in the same space/relationship - in its initial configuration.
 
Each object has a local transformation matrix relative to its parent
 
B is parented to A
B is initially positioned so that it is touching object A to the left side (Negative right translation)
 
A is parented to V
 
V is the root of the graph
V is treated as a view matrix (No projection)
Therefore it may translate and scale V - like a camera
 
All matrices are 3x3
 
Here comes the problem:
 
A will scale and move based on the transform of V
B should never be scaled by any means!
B must still touch the left side even when A scales by V (Radius is initially known for both of them)
 
How do i solve this problem?
Edited by Finalspace

Share this post


Link to post
Share on other sites
Advertisement
If you need b to not scale when a scales I wouldn't parent B to A, I would just transform the anchor point on A to world coordinates every frame and place B at that spot.

Share this post


Link to post
Share on other sites

nest rotations, but not scaling. that's how my rigid body animation system works. a limb (bone) can have a scale factor, but its not applied to the children, only rotations are.

Share this post


Link to post
Share on other sites

If you need b to not scale when a scales I wouldn't parent B to A, I would just transform the anchor point on A to world coordinates every frame and place B at that spot.

 

Thats what i want, but how? Maybe some sort of distance constraint?

Share this post


Link to post
Share on other sites

So i solved it using some sort of offset function to offset it by the radius multiplied by some direction. But has the downside that it wont work when the origin of the object is not zero.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!