Game Development Community

Get path position rotation quaternion question

by Griffin Milsap · in Torque Game Engine · 12/30/2005 (11:22 am) · 6 replies

EDIT: VERY OLD QUESTION. RESOLVED AND NO NEED TO ANSWER.
Edited to remove image links to a domain I no longer own or use. Just writing this in case editing bumps.

Hey,

I'm using the get path position to find the coordinates of a point on a path. Once I have that point, I create a series of points around that point in the shape of an octagon.

The octagon follows the path just fine, but I was expecting it to rotate with the path.

I'm using the rotation quaternion given to me by the getPathPosition like so:

getPathPosition(id, msPosition, pPos, pRot); //Get the point pos and rot

//Next, we translate and rotate the points to the path.

MatrixF xRot, zRot;
xRot.set(EulerF(pRot.x, 0, 0));
zRot.set(EulerF(0, 0, pRot.z));
MatrixF temp;
temp.mul(zRot, xRot);
temp.setColumn(3, pPos);
	
for(U32 i=0; i<8; i++) //Multiply the point by the transform matrix
{
	temp.mulP(*points);
        points++;
}

It translates the points correctly, but upon debugging, I find that the rotation quaternion is:
X:0
Y:0
Z:0
W:1

What does the rotation quaternion do? Is it supposed to be like this? Am I using it correctly? Why is it wrong?

-Griff

#1
12/31/2005 (8:30 am)
Does nobody know?

Is it because of a lack of information?

Is it because it should work?

Is it because of the website cutting off half my pictures and the reply box?

-Griff
#2
12/31/2005 (8:35 am)
Its not cutting it off atleast for me there is a scroll bar at the bottom of the post so you can move it over to see the rest.

I don't know the answer to your question but I'm guessing it is because of the holiday season that traffic to the site has dropped. My suggestion is to bump the thread in the middle of next week.
#3
12/31/2005 (6:54 pm)
Have you tried just getting pos at t and t + 0.001 and taking the vector between them for rotation? :)

The quaternion ought to rotate you to face the right way, but it might be relative to the tangent or something.
#4
12/31/2005 (10:17 pm)
Yeah, I came up with all the math for it, but I thought that the quaternion would save me some processing power...

Oh well... It shouldn't run too much slower.

-Griff
#5
01/01/2006 (2:58 pm)
Actually, are the nodes in your path rotated to face forward? If not, then the quat will (correctly) always return the same direction.
#6
01/02/2006 (7:03 pm)
That could be it, Ben!

I'll give that a shot in a bit!

My math doesn't work as well as it should, and its slow.

-Griff