Both ways are not woking.
Am i doing something wrong? Is it a knowledge problem?
What i recognized so far is, that the getNormal method of the terrainQuad returns a vector between 0 and 1.
So i guess, i have to calculate that vector in some way to make it useable by the lookAt or rotateUptTo method.
But how do i do this?
I hope your know what i mean. If not please let me know.
All the meshes are rotated in the same direction. And that is wrong.
Yes, that is exactly what i mean.
A normal surface vector is a vector that stands 90° to a surface as far as i know.
That is the reason why i wanted to get the normal vector of the point of the terrain and to align the stone on that vector.
But maybe i miss the point that i need a vector that represents the up vector of the stone so the stone can be aligned on the terrain normal surface vector. That came to my mind, while i am writing these lines.
Am i on the right way or completly mistaken?
Not sure about the rotation issue, but you should multiply the value of your terrain by the terrain height multiplier. If for example your terrain height is 128, multiply it by that.
Well, a normal vector is a direction vector… unit length… so of course the values will be between 0 and +/-1. That’s why I asked.
Step 1: print out the normals to see if they are actually what is to be expected… ie: that they are different. I guess you are already doing this.
Else rotateUp() should work. You can verify that it’s doing its job by seeing what the result of getLocalRotation().mult(Vector3f.UNIT_Y) is… should be the same as the normal after the call.