Negative Y Isn't Going Up

Started by AGP, January 26, 2014, 09:57:36 PM

Previous topic - Next topic

AGP

I have a scene that's completely aligned with its SkyBox. Yet when I translate an object with mainGate.translate(0, -deltaTime, 0), it moves on what I think is the x/z plane. What gives?

EgonOlsen

Maybe your camera doesn't look down the z-axis but down the y-axis? Has the object been rotated?

AGP


EgonOlsen

I see...due to the way in which the transformations of childs and parents are concatenated, this will actually rotate the child's object space coordinate system. You might want to try this instead:


SimpleVector ya=parent.getYAxis();
ya.scalarMul(deltaTime);
child.translate(ya);

AGP

I see, thank you. Does the fact that it worked confirm that the game is in fact in the x/z plane?

AGP

How do you feel about adding a removeParentButCommitTransformations() (or whatever you want to call it) method to Object3D?

EgonOlsen

Quote from: AGP on January 26, 2014, 10:28:59 PM
I see, thank you. Does the fact that it worked confirm that the game is in fact in the x/z plane?
Yes, all is fine then.

AGP

Cool. What about the method? Is that a possibility? You can clearly see how useful it would be (whenever you have multiple parts of a single set that need to be rotated and translated into place).

EgonOlsen

I'll look into something like that...