Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / NVRotate

Author
Message
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 02:31
Will NVRotate solve my rotation problems? Specifically, I need a vector pointed to, say, the "right" of an arbitrarily rotated object. Will NVRotate (for $20...) fix this problem of mine and give me a vector to the right?
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 02:38
Quote: "NVRotate"


Do you mean EZrotate?


a.k.a WOLF!
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 02:53
Yes. Yes I do. EZRotate. Sorry about that. EZRotate is what I meant.
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 03:27
EZrotate will solve most rotation problems pretty easily. On more difficult things, it can definately (at the very least) make things much easier.

Can you describe your problem in a little more detail to me? Thanks!


a.k.a WOLF!
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 03:33
Okay. Here's the broken code.



Basically I'm using dbPickScreen(middle.of.screen); to get a unit vector pointed in the direction the camera is pointed. I want the spaceship to accelerate to the right and left (when a & d are pressed, respectively), and to do that I need a unit vector pointed to the left of the direction that the camera is pointed.

I also need to do this for arbitrary objects, for which there is no dbPickScreen function! That is to say, 3d objects with arbitrary yaw & pitch rotations applied to them...I need a vector pointed to the right and a vector pointed up of the direction these objects are facing. Unit vectors are preferred, so I can plug them into my 3D math functions to calculate the newtonian physics of space flight.
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 17:08
aersixb9,

That should be easy to do. If I understand correctly, you are just looking for a forward, up, and left/right vector for each object (or the camera), correct? If so, you can simply convert the Euler rotation of the object/camera to a matrix. Then you just take the Y axis vector info for the up vector, the Z axis vector info for the forward vector, and the X axis vector info for the right vector.

-Ron


a.k.a WOLF!
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 17:31
ITLTRTHF....

You lost me on "*simply* convert the Euler rotation ... to a matrix"

Now I saw the Matrix at least 30 times, and I've seen Matrix 2 at least a dozen times, and I've even seen Matrix 3 a few times...and I have no idea how to convert an Euler Rotation (I know how to get the Euler Rotation, wait, I don't know how to get the Euler rotation IRTHF...what's the function to get the euler rotation of an object? Or do I need to keep track of the rotation myself?) to a matrix. I assume it would be like a cross between a math lecture and a movie? Maybe a movie about math...sorry...okay, the actual question is

How do I get my Euler angles from the object?
How do I convert my Euler anges to a Matrix?
How do I get the rows of the matrix? (heh)
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 18:03
Quote: "How do I get my Euler angles from the object?"


Euler rotation is the convention that DarkGDK/DBpro uses. So, all you have to do to get the Euler rotation of your object is return the object's current rotation.
FYI, Euler rotation is a combination of global rotations on the X, then Y, then Z axis, that describe the orientation of your object. It is order dependent (if you changed the order that you applied the rotation, the end result would be different). All three rotations work together to produce the final result.

Quote: "How do I convert my Euler anges to a Matrix?"

You can use EZrotate to do this

Quote: "How do I get the rows of the matrix? (heh) "

You just return them. There is a matrix class that provides all of the vector data for each axis. It works like this:

Matrix(0,0) = X, of the X axis
Matrix(0,1) = Y, of the X axis
Matrix(0,2) = Z, of the X axis
Matrix(0,3) = 0

Matrix(1,0) = X, of the Y axis
Matrix(1,1) = Y, of the Y axis
Matrix(1,2) = Z, of the Y axis
Matrix(1,3) = 0

Matrix(2,0) = X, of the Z axis
Matrix(2,1) = Y, of the Z axis
Matrix(2,2) = Z, of the Z axis
Matrix(2,3) = 0

Matrix(3,0) = Position X
Matrix(3,1) = Position Y
Matrix(3,2) = Position Z
Matrix(3,3) = 1

I hope this helps!


a.k.a WOLF!
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 18:35
Did you make EZRotate Ron Erickson?
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 19:37
Yes.


a.k.a WOLF!
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 18th Dec 2007 19:44
Can I try it, and if I like it, I'll send you 5 handmade redwood pipes made from ancient redwoods of the central coast of California, and 5 hand-ground double edged (or 3 double edged and two single edged) full tang razor sharp knives? (Some with and without serration. Perfect for gutting fish and for self defense!)

Act now and I'll throw in a haiku!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 18th Dec 2007 19:52 Edited at: 18th Dec 2007 21:32
Not smart.

E-mailing me and asking me for a pirated version of TGC's software was a pretty dumb move. That was just BAN-tastic!

If you would have asked, I would have been happy to send you a fully-functional time-limited demo version of it so you could see for yourself how much this was worth the $20. Your loss. Bye-bye!

Edit:
After receiving an e-mail from someone questioning this ban, I want to stress that it was not based on these forum messages. It was based on an e-mail that I received from this user specifically requesting a pirated copy of EZrotate. As I said above, not smart.


a.k.a WOLF!
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 19th Dec 2007 02:33
I hate pirates

I often wonder how can people afford 3ds max and then get mad cause they had to pay for a plug-in.

Login to post a reply

Server time is: 2024-11-17 00:39:50
Your offset time is: 2024-11-17 00:39:50