AggrorJorn Posted May 11, 2010 Share Posted May 11, 2010 I've been trying to adjust the lua scripts from the metal01 door out of the sdk. The door can rotate around it's axis in the y axis. However I want to rotate my object (copied the script) around the x axis. When the hinge joint is created it uses some parameter I don't understand. self.joint = CreateJointHinge(self.body,self.model,pos,self.model.mat:J() I get the first 3 parameters, but then this last parameter uses ".mat:J()". First: was does this do? and second: is this effecting the axis direction. Quote Link to comment Share on other sites More sharing options...
Canardia Posted May 11, 2010 Share Posted May 11, 2010 J is one finger direction of the matrix (up, right, forward). Although many people believe mathematics should use the right hand rule ( http://en.wikipedia.org/wiki/Right-hand_rule ), I think it's better to use the left hand rule ( http://en.wikipedia.org/wiki/Left-hand_rule ), since all good things should grow in positive direction (up=good, right=good, forward=good). Also in 3D graphics, X+ means always right, Y+ means up, Z+ means forward, although many 3D programs do it wrong. 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...
TylerH Posted June 18, 2010 Share Posted June 18, 2010 I, J, and K will give you the local axes of the model relative to itself. The parameter it is passing to the hinge function I believe is the "pin", which is the axis it rotates on. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- 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.