|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I am continuing to develop my bezier spline macros, but I am currently
having a problem with banking the object to have a realistic motion
along the curve. Does anyonw have any suggestions?
--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 31 Mar 2000 14:34:48 -0800, Josh English
<eng### [at] spiritonecom> wrote:
>I am continuing to develop my bezier spline macros, but I am currently
>having a problem with banking the object to have a realistic motion
>along the curve. Does anyonw have any suggestions?
Take the second derivative of the equation of motion you are using and
use (scaled to a proper range of course) to rotate the object around
the axis formed by the first derivative of aforementioned function. I
hope I know what I am talking about at this time of night :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Peter Popov wrote:
>
> On Fri, 31 Mar 2000 14:34:48 -0800, Josh English
> <eng### [at] spiritonecom> wrote:
>
> >I am continuing to develop my bezier spline macros, but I am currently
> >having a problem with banking the object to have a realistic motion
> >along the curve. Does anyonw have any suggestions?
>
> Take the second derivative of the equation of motion you are using and
> use (scaled to a proper range of course) to rotate the object around
> the axis formed by the first derivative of aforementioned function. I
> hope I know what I am talking about at this time of night :)
Close enough for government work. Take the 2nd derivative of the motion,
which will be a vector inward of the curve. From this subtract a vector
representing the force of gravity; since gravity is down, the result will
be mostly up, tilted by the amount of acceleration. Normalize the
result. That's the new "up" vector for the object.
Since a bezier spline uses the equation
P(u)=(1-u)^3 * P_0 + 3*u*(1-u)^2 * P_1 + 3*u^2*(1-u) * P_2 + u^3 * P_3
The first derivative ought to be
dP/du= (-3+6*u-3*u^2) * P_0 + (3-12*u+9*u^2) * P_1
+(6*u-3*u^2)*P_2 + 3*u^2 * P_3
and the second ought to be
d^2P/du^2 = (6-6*u)* P_0 + (-12+18*u) * P_1 + (6-6*u) * P_2 + 6*u * P_3
Now to get the object placed and banked, calculate the position along
the spline, and the first two derivatives, and place them in the variables
Location, Velocity, and Acceleration.
The velocity becomes your object's forward vector:
#local VecF=vnormalize(Velocity);
From the acceleration, you require only the portion that is perpendicular
to the direction of motion:
#local VecA=Accleration-VecF*vdot(VecF,Accleration);
From this, subtract the vector for gravity and normalize the result:
#local Gravity=<0,-9.8,0>; // gravity is down at 9.8 m/sec^2
#local VecU=vnormalize(VecA-Gravity);
Then you get your right-hand vector for a full transformation:
#local VecR=vnormalize(vcross(VecU,VecF));
And then recalculate the up vector (in case the forward motion is
going up or down a slope):
#local VecU=vnormalize(vcross(VecF,VecR));
and then invoke it wall with a matrix transform. If your object
is modeled so that z is forward and y is up,
matrix < VecR.x, VecR.y, VecR.z,
VecU.x, VecU.y, VecU.z,
VecF.x, VecF.y, VecF.z,
Location.X,Location.Y,Location.Z >
Hope this helps (and isn't full of bugs),
John
--
ICQ: 46085459
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Fri, 31 Mar 2000 23:11:20 -0500, John VanSickle
<van### [at] erolscom> wrote:
>Close enough for government work. Take the 2nd derivative of the motion,
>which will be a vector inward of the curve. From this subtract a vector
>representing the force of gravity; since gravity is down, the result will
>be mostly up, tilted by the amount of acceleration. Normalize the
>result. That's the new "up" vector for the object.
What do you mean, 'gravity' :) I was talking with spaceships in mind.
Hope your math works, I'll try it as well.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Peter Popov wrote:
>
> On Fri, 31 Mar 2000 23:11:20 -0500, John VanSickle
> <van### [at] erolscom> wrote:
>
> >Close enough for government work. Take the 2nd derivative of the motion,
> >which will be a vector inward of the curve. From this subtract a vector
> >representing the force of gravity; since gravity is down, the result will
> >be mostly up, tilted by the amount of acceleration. Normalize the
> >result. That's the new "up" vector for the object.
>
> What do you mean, 'gravity' :) I was talking with spaceships in mind.
>
> Hope your math works, I'll try it as well.
A moving vehicle needs to bank into turns only if there is an upward force
involved in the turning. This is indeed the case with airplanes and cars.
Whether it is true for a spaceship depends on how the spaceship is designed.
Regards,
John
--
ICQ: 46085459
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 01 Apr 2000 10:12:30 +0300, Peter Popov wrote:
>What do you mean, 'gravity' :) I was talking with spaceships in mind.
Spaceships don't bank (unless they are in a movie :-)
hp
--
|_|_) | Sysadmin WSR \ Durchbruch in der Bionik, und Microsoft geht
| | | hjp### [at] wsracat \ Pleite und Gardena bringt organische PC's
__/ | http://www.hjp.at/ \ auf den Markt. -- Stefan Schaefer
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 1 Apr 2000 20:10:13 +0200, hjp### [at] SiKituwsracat (Peter
J. Holzer) wrote:
>On Sat, 01 Apr 2000 10:12:30 +0300, Peter Popov wrote:
>>What do you mean, 'gravity' :) I was talking with spaceships in mind.
>
>Spaceships don't bank (unless they are in a movie :-)
The ones I've designed as a kid do. And they had to, because the
design of the thrusters was done so. I agree there's no need to bank
in zero gravity, but it sometimes helps :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG e-mail : pet### [at] tagpovrayorg
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Peter Popov" <pet### [at] usanet> wrote in message
news:P03mOB6Q1V6pxDEAoifGtvw+AXO7@4ax.com...
> On Sat, 1 Apr 2000 20:10:13 +0200, hjp### [at] SiKituwsracat (Peter
> J. Holzer) wrote:
>
> >On Sat, 01 Apr 2000 10:12:30 +0300, Peter Popov wrote:
> >>What do you mean, 'gravity' :) I was talking with spaceships in mind.
> >
> >Spaceships don't bank (unless they are in a movie :-)
>
> The ones I've designed as a kid do. And they had to, because the
> design of the thrusters was done so. I agree there's no need to bank
> in zero gravity, but it sometimes helps :)
Why is there no need to bank in no gravity?
The pilots will be pulled to the side when turning if they don't bank!
The centrifugal force still works in no gravity.
Greetings,
Rune
---
Updated March 15: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Sat, 01 Apr 2000 22:27:07 +0300, Peter Popov wrote:
>On Sat, 1 Apr 2000 20:10:13 +0200, hjp### [at] SiKituwsracat (Peter
>J. Holzer) wrote:
>
>>On Sat, 01 Apr 2000 10:12:30 +0300, Peter Popov wrote:
>>>What do you mean, 'gravity' :) I was talking with spaceships in mind.
>>
>>Spaceships don't bank (unless they are in a movie :-)
>
>The ones I've designed as a kid do. And they had to, because the
>design of the thrusters was done so.
Hmm, the ships I designed when I was a kid had their thrusters at the
back, just like a plane or the ships in Star Wars (I was ten years old
when that came out).
won't fly a curve, with the axis of the ship tangential to the curve.
the direction you are going now and the opposite of the direction you
want to go. Then you will fire your thrusters until you are flying in
that it points in the "right" direction.
Apart from the spins at the start and the end of the maneuver, the
g-force will always point straight to the back of the ship.
Of course you may have designed your ships differently.
hp
--
|_|_) | Sysadmin WSR \ Durchbruch in der Bionik, und Microsoft geht
| | | hjp### [at] wsracat \ Pleite und Gardena bringt organische PC's
__/ | http://www.hjp.at/ \ auf den Markt. -- Stefan Schaefer
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you for those formulas. Even though my University says I've passed two
terms of Calculus, I've had some difficulty differentiating the bezier spline
formula myself.
Josh
John VanSickle wrote:
> Peter Popov wrote:
> >
> > On Fri, 31 Mar 2000 14:34:48 -0800, Josh English
> > <eng### [at] spiritonecom> wrote:
> >
> > >I am continuing to develop my bezier spline macros, but I am currently
> > >having a problem with banking the object to have a realistic motion
> > >along the curve. Does anyonw have any suggestions?
> >
> > Take the second derivative of the equation of motion you are using and
> > use (scaled to a proper range of course) to rotate the object around
> > the axis formed by the first derivative of aforementioned function. I
> > hope I know what I am talking about at this time of night :)
>
> Close enough for government work. Take the 2nd derivative of the motion,
> which will be a vector inward of the curve. From this subtract a vector
> representing the force of gravity; since gravity is down, the result will
> be mostly up, tilted by the amount of acceleration. Normalize the
> result. That's the new "up" vector for the object.
>
> Since a bezier spline uses the equation
>
> P(u)=(1-u)^3 * P_0 + 3*u*(1-u)^2 * P_1 + 3*u^2*(1-u) * P_2 + u^3 * P_3
>
> The first derivative ought to be
>
> dP/du= (-3+6*u-3*u^2) * P_0 + (3-12*u+9*u^2) * P_1
> +(6*u-3*u^2)*P_2 + 3*u^2 * P_3
>
> and the second ought to be
>
> d^2P/du^2 = (6-6*u)* P_0 + (-12+18*u) * P_1 + (6-6*u) * P_2 + 6*u * P_3
>
> Now to get the object placed and banked, calculate the position along
> the spline, and the first two derivatives, and place them in the variables
> Location, Velocity, and Acceleration.
>
> The velocity becomes your object's forward vector:
>
> #local VecF=vnormalize(Velocity);
>
> From the acceleration, you require only the portion that is perpendicular
> to the direction of motion:
>
> #local VecA=Accleration-VecF*vdot(VecF,Accleration);
>
> From this, subtract the vector for gravity and normalize the result:
>
> #local Gravity=<0,-9.8,0>; // gravity is down at 9.8 m/sec^2
> #local VecU=vnormalize(VecA-Gravity);
>
> Then you get your right-hand vector for a full transformation:
>
> #local VecR=vnormalize(vcross(VecU,VecF));
>
> And then recalculate the up vector (in case the forward motion is
> going up or down a slope):
>
> #local VecU=vnormalize(vcross(VecF,VecR));
>
> and then invoke it wall with a matrix transform. If your object
> is modeled so that z is forward and y is up,
>
> matrix < VecR.x, VecR.y, VecR.z,
> VecU.x, VecU.y, VecU.z,
> VecF.x, VecF.y, VecF.z,
> Location.X,Location.Y,Location.Z >
>
> Hope this helps (and isn't full of bugs),
> John
> --
> ICQ: 46085459
--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|