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.

Newcomers DBPro Corner / Vectors and Angles [DB Pro]

Author
Message
Joe Staff
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location: Midsouth, USA
Posted: 11th Dec 2011 10:36
I know for a fact that this question has been asked before, I've even found a tutorial. Unfortunately my numbers are coming back weird.

Here's my situation. I have an object whom's speed is determined by velocity variables (forward, strafe, and upward). I'm using the 'move object <speed>' function which moves the object forward based on its orientation.

What I need is the angular offsets of the velocities to change the direction of the 'move object' function (Rotations X and Y). I need to use the single move-object function to cohort with Object Collision.

Here's the code I've found on a tutorial on this site:

It's to my understanding that substituting 'acos' with 'asin' will get me the other angle I need

Here's my code

Unfortunately when presenting the dot product with a vector that's 0,0,0, the returns are non-responsive. When I add '1' to all coordinates, it returns information but it seems to be very wrong.


My rotate object/move code
Joe Staff
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location: Midsouth, USA
Posted: 13th Dec 2011 05:23
Never mind, used a different method to get it.
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 17th Dec 2011 05:49
elaborate so that other people that have your problem will be able to use your answer xD

I'm guessing atan2?

Joe Staff
12
Years of Service
User Offline
Joined: 7th Dec 2011
Location: Midsouth, USA
Posted: 20th Dec 2011 23:50
No, I got lazy and just used 'move object' function. Pretty much did exactly what I was asking.

Although I wish there was a function that would just return the numbers you need

something like:
NEWXVALUE (Current X Value, X Rotation, Y Rotation, Z Rotation, Step Value)


Also a method to get X,Y,Z Rotations for one object to point at another.

Login to post a reply

Server time is: 2024-11-23 23:24:45
Your offset time is: 2024-11-23 23:24:45