0
\$\begingroup\$

I'm very bad at Math and trigonometric functions (And I dunno if this questions fits here)

I have a surface normal as a direction vector.I want my character slide along the surface, if the angle of the surface is >= 45°.
I made out that the Angle is calculated by acos((Normal x (0,0,1))
Now I need to move my character along the surface. enter image description here

\$\endgroup\$
4
  • 1
    \$\begingroup\$ I'm not quite sure what the difficulty is? You say you can calculate the angle, so just check if that angle is >= 45°. Then just translate your character according to the normalized surface vector (which is just your normal vector, but rotated 90°)? Could you expand on the question because I believe I've misunderstood it? \$\endgroup\$
    – Charanor
    Commented Jul 9, 2016 at 18:06
  • \$\begingroup\$ and how do I rotate my normal vector 90°? \$\endgroup\$
    – Raildex
    Commented Jul 9, 2016 at 18:31
  • \$\begingroup\$ Thanks, but you do realize that I used a three-dimensional vector in my question? \$\endgroup\$
    – Raildex
    Commented Jul 9, 2016 at 19:07
  • 1
    \$\begingroup\$ I literally just realized this as I posted it! Derp to me. In that case, you should probably look into rotation matrices. I'm actually not that familiar with them myself, but there are hundreds of really good tutorials on google! \$\endgroup\$
    – Charanor
    Commented Jul 9, 2016 at 19:11

0

You must log in to answer this question.

Browse other questions tagged .