Advertisement

I have solved movement on a plane!! READ NEWBS

Started by December 25, 2003 11:09 PM
1 comment, last by uber_n00b 21 years, 2 months ago
After getting little help from this forum, probably because I never explained it well, I have solved the problem of movement up an inclined plane. Given that your movement is on the side of the plane where the plane normal projects off of: IF your movement = vVector, planes normal = pNormal, then desired movement up the incline = vVector - (DotProduct(pNormal, vVector) / Magnitude (pNormal)^2 * vVector). All I did was solve for the other perpendicular component of the projection of vVector onto pNormal (And thus getting a vector parallel to the plane and would simulate smooth movement on an inclined plane) Yes, I am babbling and most of you people probably already knew this but I had to think it out
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
** bear with me here I realised some things when writing the reply **


not going to comment on if it works or not but I noticed a trick you may not realise:


the equation you put:
vVector - (DotProduct(pNormal, vVector) / Magnitude (pNormal)^2 * vVector)

is the same as:

vVector - (DotProduct(pNormal, vVector) / DotProduct(pNormal,pNormal) * vVector)

no square root here

and anyway, isn''t the normal always going to be unit length?
which would be:

vVector - (DotProduct(pNormal, vVector) * vVector;

which is:

vVector * (1- (DotProduct(pNormal, vVector));



looking at the actual algorithm.... wouldn''t it actually be / Magnitude (vVector)^2 not / Magnitude (pNormal)^2 ??

in which case wouldn''t it simplify to:

vVector + pNormal*(DotProduct(pNormal, vVector)

??

ok enough from me.

| - Project-X - | - adDeath - | - my windows XP theme - | - email me - |
Advertisement
Yeah I realized this. I normalized the plane normal somewhere in there ^^ (but its not shown, obviously). And uh, I am projecting vVector onto pNormal so I thought you were supposed to divide by the magnitude of pNormal^2. I may be wrong though. Edit: I typed it wrong. It is actually suppsoed to be multiplied by pNormal, not vVector. Thanks for pointing that out.

[edited by - uber_n00b on December 26, 2003 12:57:03 PM]
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.

This topic is closed to new replies.

Advertisement