This thread is in the Technical forum because according to documentation this should be working properly and could be a bug.
So I am trying to do a spinning sunlight object, simulating a bright moving light. This is accomplished via a script object. I added a vector skinmesh to make sure I am doing the math right and the skinmesh is pointing properly, however the sunlight object is pointing constantly downward.
Excerpt from my script, adding names of objects instead of their OBJ_ reference.
When I run this code (The real one of course), the vector skinmesh points in the proper direction, toward the spotlight object. However, the sunlight points from the top downward.
Anyone have any idea what I might be doing wrong?
So I am trying to do a spinning sunlight object, simulating a bright moving light. This is accomplished via a script object. I added a vector skinmesh to make sure I am doing the math right and the skinmesh is pointing properly, however the sunlight object is pointing constantly downward.
Excerpt from my script, adding names of objects instead of their OBJ_ reference.
Code: [Select]
iObjectLocation(OBJ_<Spotlight>, base_loc);
iVectorEulerRotate(new_loc, base_loc, 0.0f, 1.0f, 0.0f,"xyz");
iObjectLocationSet(OBJ_<Spotlight>, new_loc);
iVectorLengthSet(new_loc, new_loc, 1.0f);
iQuaternionLookAt(light_pitch, new_loc, Vector3(0,1,0));
iObjectOrientationSet(OBJ_<Vector SkinMesh>, light_pitch);
iObjectOrientationSet(OBJ_<SunLight Object>, light_pitch);
When I run this code (The real one of course), the vector skinmesh points in the proper direction, toward the spotlight object. However, the sunlight points from the top downward.
Anyone have any idea what I might be doing wrong?