Jump to content

what is self.model.mat:J() ?


AggrorJorn
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

  • 1 month later...

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.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...