# How do i solve this specific scene graph problem

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

## Recommended Posts

Hi,

i have a 2D scene graph.

i have object A, object B and transform V.

A is a sphere

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 on other sites

when A scales, B moves.

##### 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.

##### 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 on other sites

You can also undo the scale of the parent in the child node. Simplified something along those lines (note that you undo the scale after the translation):

M1 * M2 * v = M1 * ( T2 * S1^-1 * R2 * S2 ) * v

IIRC this is what Maya does for the IKJoint:

##### 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 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.

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 26
• 10
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633717
• Total Posts
3013510
×