Jump to content

# Matrix on Babylon.js

## Recommended Posts

Hi everyone,

I'm a new user of babylon.js and i'm trying to understand what the [meshe].getWorldMatrix() and the [scene].getTransformMatrix() matrix are representing.

What is a WorldMatrix ? when I try to recuperate the world matrix of a picked mesh, I obtain a 4*4 matrix with the Identity Matrix for 3*3 Submatrix at the top left, and  with the 3D position at the 4th line and I don't understand why it is like that.

And concretely, how the 'Project' function is running ? I have good knowledge in algebra but I have trouble with the documentation.

Thanks !

##### Share on other sites

Welcome on board SolidCatuar.

The following link could be helpful: http://www.html5gamedevs.com/topic/3083-spaces-world-parent-pivot-local/?p=19938 especially the "Things to remember" section.

It doesn't explain everything so I'll try to give you more information if after reading this you still need it.

##### Share on other sites

Hello gwenael, thanks for your fast response

I had already seen this post but it doesn't really help me for the time being because I don't understand the basics. Can you explain me what is this world matrix  ? What will I learn by playing with your jsfiddle (http://jsfiddle.net/...enmuller/Wcegj/) ? And is that what you call 'space' are basic space transformation ?

##### Share on other sites

In this topic it is stated that "The world matrix represents the scale, rotation and position of the object in the world", but world matrix is a 4*4 matrix so what the 4th line is representing ?

##### Share on other sites

Scale and rotation are in the 3*3 matrix, position must be stored in the 4th line (for row-major order matrix such in babylon.js) or in the 4th column (for column-major order matrix). More about row-major and column-major order: http://en.wikipedia.org/wiki/Row-major_order

## 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.

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.

Loading...
×
• ### Recently Browsing   0 members

• No registered users viewing this page.
×
×
• Create New...