Andy Gilbert Posted November 28, 2012 Share Posted November 28, 2012 Hi, im having a few issues regarding some physics and in talks with Somone who is helping me out, he is suggesting that in order to achive the result i need to Rotate the vector with the body matrix? P = RotateVector (vehicle matrix, CP) <-- no LE command (its what he suggested) After playing around more and having no luck I questioning it again and it was advised again that its because i am transforming the vector and not rotating it. And suggested i do somthing like this: pg = TransformVector (bodyMatrix, p) Anyone know what he means by rotate the vector with the bodymatix? Is this somthing i can do using TFormVector? Sorry if this all sounds a bit wishy washy. Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Canardia Posted November 28, 2012 Share Posted November 28, 2012 Maybe it would be better to explain what the actual problem is, usually LE2 has already the commands built-in, and there is no need to math. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Andy Gilbert Posted November 28, 2012 Author Share Posted November 28, 2012 Im trying to calculate the velocity at a point on a body which is rotating. The equation is simple: P be the local position/offset in global space, V, the linear velocity W and angular velocity of the body Vf = V + cross (W, P) So in LE i do this: P = Vec3(5,0,0) V = GetBodyVelocity(body,1) W = GetBodyOmega(body,1) lvel = cross(bodyav,TFormPoint(offset,body,nil)) vf = AddVec(bodyV,lvel) This caused crazy results and doesnt work, as soon as the body starts to rotate vf results in an axis having a massive number. So, ive been told this is because im transforming the point and not rotating it and suggested: (not LE code) P = Vec3(5,0,0) V = GetBodyVelocity(body,1) W = GetBodyOmega(body,1) globalOffset = TransformVector (bodyMatrix,P) - bodyMatrix.GetPosition() lvel = cross(bodyav,globalOffset) vf = AddVec(bodyV,lvel) Does this make any more sense? Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Canardia Posted November 28, 2012 Share Posted November 28, 2012 In LE you should rather create a pivot, move it to the desired position and then parent it to the physics body. Then you can measure the speed of the pivot. That should be much faster than calling so many functions. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Andy Gilbert Posted November 28, 2012 Author Share Posted November 28, 2012 ok, ill give that a go Thanks Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.