@zicklag I have a little more time to help you today. A first advice would be to take some time to familiarize yourself with the quaternions. This is essential to achieve a successful project (less CPU demanding) and not be confronted with rotation problems (cf. “cardan” problem with Euler).
Let’s quickly summarize the need in 3 steps:
1/ obtain the quaternion qa which allows to pass from the vector A, normalized which represents the displacement of your object I suppose and noted â, to the vector N, perpendicular to the plane of projection which you have and noted ^n (read the cap on the n) (normalisation is essentiel before getting qa).
2/ applying this rotation qa to the vector A gives a vector A’ perpendicular to the inclined plane (thus // to N)
3/ do a tilt/attitude of -90° to A’ and “it’s done”
Thus to do it:
- you will find the “fromTo” function in “Armory/iron math quat” to get the qa quaternion.
- to set attitude -90° to A’, just apply a quaternion with x = 0, y = 0, z = -0.7071, w = 0.7071