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 AppGameKit Corner / How to get the X, Y and Z coordinates from a starting x,y and z accounting for x, y and z rotation?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 11th Dec 2017 16:59
I want to position an object to always be in front of player, accounting for the players rotation.

Now I can technically do that if I use the objects center rotation point to my advantage by moving the objects to that approximate position in my modeling software and exporting like that instead of making sure that the objects is at the dead center of the workspace before exporting. In that case I just have to use the objects local rotation in AppGameKit to have the objects be rotated with the player camera.

But the function I need to do this in code would be used in many other places so I need to figure this out code. wise.

Provided original X, Y and Z, Distance from X, Y and Z and X,Y,Z rotation, how can you get the second position?
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 11th Dec 2017 19:40
can you not just place it at the player's location and rotation and then move it locally forward with MoveObjectLocalZ()?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 11th Dec 2017 19:54
Ah, so the local X, Y and Z are following the World X Y and Z then? That's actually exactly what I needed.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
blink0k
Moderator
11
Years of Service
Recently Online
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Dec 2017 21:49
If it is ALWAYS in front of the player you could use FixObjectToObject() to attach the object in front to the main object and it will always be in front

Login to post a reply

Server time is: 2024-11-22 20:45:50
Your offset time is: 2024-11-22 20:45:50