I have some problem with CrystalSpace coding...
I have 2 balls (B1 and B2), located at position P1 and P2.
I have a mesh, created with
<min x="-0.02" y="-0.3" z="-0.02" />
<max x="0.02" y="0" z="0.02" />
and named Rod.
I would like to put the Rod between the two balls, then rotateit into the right position (between the two balls) and maybe scale it.
Right now I put the Rod into the right position with:
csVector3 P1 = B1->GetMovable()->GetPosition();
csVector3 P2 = B2->GetMovable()->GetPosition();
Rod->GetMovable()->SetPosition(P1); /* or P1 + ((P2 - P1) / 2 ) or something */
and it is working properly, but i dont know how can i rotate the Rod into the right angle.
but this is too mystic for me, maybe my math skills not high enough.
Anyway, is here anybody, who would be so kind to help me and answer ?
(maybe with a code snippet ? B-) )