View Full Version : Perpendicular

Gelero

08-31-2001, 06:11 AM

hi guys!

how are you these days ???

how can i find a perpendicular plane of any direction??

i mean, i have a missile... and its going to blow something in a parabolic trajectory...

how can i find the plane perpendicular to the missile...

i m trying to do a shockwave with quadratic disk, increasing his size...

give me some code,ok ???

see you!

cyclone

08-31-2001, 06:42 AM

First, you can easily compute the derivative of your parabole for to have the first vector

derivative = ( f(t1) - f(t0) )/(t1-t0)

After, you have only to choice an arbitrate vector such as {0,0,1} and compute the cross product of this two vector for to find one normal plane at this point f(t).

@+

Cyclone

Gelero

08-31-2001, 07:03 AM

No man... forget the parabolic trajectory!

imagine na missile going straight to -z, ok ???

so perpendicular plane is the Yaxis....

thats what i want to know!

The plane perpendicular to the rocket is the plane with the formula Ax + By + Cz + D, where the vector <A,B,C> is the direction of the rocket and D is the distance of the plane from the orgin.

What I mean by "direction of rocket" is the direction the rocket is traveling in.

You can get this number by projecting a ray from the orgin in the direction of the normal and checking along the ray to find the point on the ray where the dot product of the direction of the rocket and the vector from the point on the ray to the rocket's position is 0. The distance between the point on the ray that satisfies this and the orgin is D.

I think that's right, but I'm sure that if it is wrong, somebody will correct me.

j

[This message has been edited by j (edited 09-01-2001).]

Gelero

08-31-2001, 07:47 AM

yeah j, i guess you are right! but i need some code man!

its hard to me, ( who knows basic english ) to understand only via theory... can you give me a piece of code ???

thanks!

DFrey

08-31-2001, 08:49 AM

Actually j, that will only work if you are assuming the rocket is moving directly toward or away from the origin as the direction to the rocket can be quite different from the direction it is moving towards.

Its actually not quite clear to me what Gelero wants. Do you want the plane perpendicular to the trajectory of the rocket? Or something else?

If you want it perpendicular to the trajectory, then assuming the position of the rocket is a function of time, you can take the time derivative of the function to get the vector that is tangent to the trajectory and it would therefore be the normal of the plane perpendicular to the trajectory once it has been normalised. Then using the position of the rocket itself, you could solve for the remaining term, D.

Gelero

08-31-2001, 08:56 AM

http://www.opengl.org/discussion_boards/ubb/frown.gif

http://www.opengl.org/discussion_boards/ubb/frown.gif

come on guys!!

im sorry, its very hard to me understand completely theory in english...

i need to see some code... its universal language... see ??? ive been programming for almost 10 years... so i can understand almost everything...

yeah DFrey, what i want is the perpendicular plane to some kind of trajectory...

imagine a rocket going to somewhere from -x... POW!!! i want to draw (increasing the size of) a quadratic disk... like a shockwave... just this...

coz my actually shockwave just grows on Xaxis...

thanks!

take care!

shoot

08-31-2001, 09:23 AM

Hi!

What means "from -x... POW!!"

Well I supose that you have a rocket... with a point that's the position, and another point that's the velocity vector... of the rocket. (forgotting trajectory's formulas)

isn't it?

And you want to know, the perpendicular vector of the velocity...

Isn't it?

MARC

Gelero

08-31-2001, 09:39 AM

means that rocket comes from -x and explodes the target!

Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.