|
Post by Deep Gaurav on Oct 30, 2015 11:23:37 GMT
First of all..,, sorry guys if this thread exist or am posting in wrong place (I am new here)
Now, The thing is I need to get quaternion for a bone in skinmesh such that it points at an particular point i.e Playr or something... But I can't find function to calculate quaternion for a point from two Vector3.....
|
|
|
Post by n_iron on Oct 30, 2015 11:57:45 GMT
Hi deepgaurav welcome to the forum.
You must have some script knowledge, that's good. You can get a quaternion from :-
iQuaternionLookAt(Quaternion,Vector3,Vector3) Quaternion = resulting quaternion. Return data. It is the rotation required to orientate the Z+ vector D3DXVECTOR3(0.0f,0.0f,1.0f) to the specified direction.
To get further info on this and other 3DRAD functions hit the Help button in the script dialog then click the link to the Script Object Reference.
I also have on my website lots of project examples that I have collected from the old 3DRAD forum.
n_iron
|
|
|
Post by Deep Gaurav on Oct 30, 2015 13:15:26 GMT
Thanks for help n_iron but it didn't worked actually and I had already spend a day on that function.. Whenever I try to do it, the bone of the mesh behaves just ackwardly . Check my project here (I can't upload zip here that's why linking) it I think I have got something wrong or else most of it is wrong... And I am not that skilled in angelscript actually this is my first time but I know Python and GML(just a biit)
|
|
|
Post by n_iron on Oct 30, 2015 23:36:48 GMT
Hi deepgaurav I have not had any experience at bones manipulation so I can't help you with that. Also I have no idea what you are trying to achieve.
Some ideas
float iVectorLength(Vector3) Return the length of the specified vector. Vector3 = source vector
iVectorRotate(Vector3,Vector3,Quaternion) Vector3 = transformed coordinates (vector). Return data. Vector3 = coordinates (vector) to rotate Quaternion = quaternion representing the rotation to apply
iVectorEulerRotate(Vector3,Vector3,float,float,float,string) Vector3 = transformed coordinates (vector). Return data. Vector3 = coordinates (vector) to rotate float = first rotation. See character string below. float = second rotation. float = third rotation. string = 3-character string specifying the axes and the order in which to apply the rotations. For example, "xyz" (apply first rotation about X axis, then second rotation about Y axis and then third rotation about Z axis), "xzx" and "xzy" are valid strings.
iVectorCompare(Vector3,Vector3,float) Vector3 = first vector. Vector3 = second vector. float = threshold. Set this value to zero for a strict comparison (the function returns true if the vectors are identical) or specify a positive value to check if the difference between each vector component (X,Y,Z) is within a certain threshold.
|
|
|
Post by Deep Gaurav on Oct 31, 2015 1:03:33 GMT
Thanks for your try... let's leave bones i just wanted to orient a object(i.e skinmesh/rigidbody/projectile) towards a specific point such that whenever the point moves it orient itself likewise... ex:- just as a character points towards it's target /////////////////////// i want to make it just like the turret plugin but instead of turret a bone aims at target... If you had turret plugin please give it(i lost mine,, and 3drad.com is gone ), i will modify it accordingly thanks again......
|
|