I have two scenegraph objects, each with a 3x3 rotation matrix and a location point. How do I make the two objects push away from each other and pull towards each other. I figure you want to do a lookAt and translation for both objects. What are the specific parameters to pass to lookAt?
Do you want to move the two Nodes away from and towards each others? Isn't this a case for a physics engine then? I advise you to tkae a look at
JOODE and
ODEJava. Both are discussed on
javagaming.org.
A physics engine wuold do the translation maths for you and you would only need to apply them to the scenegraph objects.
If you only want to make the Nodes look at or face away from each others, then a transformed look at is the right thing. This means, you to a regular lookat and then transform it with the localtovworld transforms of the nodes.
Another thing I had a difficult time coding is zooming on a scenegraph with a root branch group that has 2 rotation matrices and a translation matrix. Then, each object on that root branch group have their own rotation, scale, and translation matrices. Each object in the scenegraph needs to be scaled and then, I need to scale their positions. For some reason I haven't gotten it to work yet.
Hmm... not sure, if I understood you right. But isn't this a cose for translating the view? Don't move/rotate/scale anyting in the scenegraph, but simply move the view (camera) around.
Marvin