• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Rotation expressed as a normal.

This topic is 5825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m pretty sure there must be a way to do this which I haven''t found yet. Can you use the x,y,z rotation (which will represent a players spacial orientation) to obtain a vector normal that will also represent the direction they face from their position? You will not beleive how long I''ve been working on this problem, and it is of the most serious importance to me.

##### Share on other sites
Seems like you could. Assuming the direction is (1,0,0) then you rotate around the z axis with from x to y postive then your point becomes (cz,sz,0). You then rotate around the y axis so your y remains unchanged and your point becomes (cz*cy,sz,cz*sy). So maybe (cz*cy, sz*cx-cz*sy*sx, cz*sy*cx+sz*sx) or some similar combination. cx would be cos(x) and sx sin(x) and similarly for y and z.

##### Share on other sites
Thanks. I was thinking something with the cos/sin pairs, but what I''ve tried hasn''t worked so far. I haven''t tried the rotation formula though. I guess I won''t have to normalize this.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 17
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634094
• Total Posts
3015498
×