# i have a land normal and a guy

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

## Recommended Posts

i needed to have my game character be standing at the same angle as the land normal. Whats the formula using vector angles?

##### Share on other sites
do i have to use a martix? i wanted to be able to find the x and z and y angles seperately of a vector.

im on my 38th computer, cmon, gimme. im american, americans might know whaqt the word gimme is. and i need life insurance. I bought a busines liscence for game programming, im making a twisty racing fighting game, can you gimme the formula? I would have wasted all day long about five years ago, but by now my patience and food intake is about dead and buried. I dont ever hack any blinking computer at all, can you ever gimme something back, like the formula im after? I feel like being upfront about the amount of money thats gone through my famiulies walltes liek diareah through toilet pipes. can i get some formula?

[Edited by - amerisgeekon on January 6, 2008 6:22:15 PM]

##### Share on other sites
Theres no 'forumula' per se,
Rather all you have to do is set the 'guy's local z axis equal to the normal of the floor, then decide on where his local x and y should point.

Typically I'll just choose to keep the previous direction he was facing matching the new position. (where y is his front)

So something like:
given:
z0,y0,x0,floornormal

z1=floornormal
x1=y0 cross z1 //note the use of y0 here, to ref. the previous dir. heading
y1=z1 cross x1
normalize x1
normalize y1
normalize z1

then just use those 3 axis to define an orientation matrix, much simpler than trying to compute a set of angles

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
12
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013738
×