Jump to content

scaling and pivot matrix


phil1234
 Share

Recommended Posts

hi,

 

I just found out I had to multiply the pivot matrix values to compensate the object scaling

 

is there no way to have the matrix transform applied AFTER the scaling ?

mesh.setPivotMatrix(BABYLON.Matrix.Translation(10,0,0));   // got to multiply by 10 to compensate 0.1 scale ...mesh.scaling=new BABYLON.Vector3(0.1,0.1,0.1);

also I found odd that "mesh" is used as the object holding everything instead of beeing the object holding only faces and vertices like in any other 3D api

 

regards

Link to comment
Share on other sites

Hey Phil,

 

just set mesh.position to get a translation matrix applied after the scaling

 

And for your second point: we are not like any other API :)

 

It works, but then the rotation I do at each frame, is back to the object's center instead of 0,0,0

witch is not what I want

 

it's a matter of logic, scenegraph nodes can represent anything(light, camera, ...) , 3D objects are a "particular" case that holds a mesh and materials,

I mean your API does the same, but I would'nt have called it mesh, that's all :-)

Link to comment
Share on other sites

Hi Phil

Quote

it's a matter of logic, scenegraph nodes can represent anything(light, camera, ...) , 3D objects are a "particular" case that holds a mesh and materials,

Actually, BJS has no "node" called 3D object.  BJS nodes are lights, cameras, and mesh.  BJS mesh do not "hold" materials and vertexData... they REFERENCE them.  Lights are as much a "particular" node as meshes are.  Lights "have" methods and properties particular to lights.  Cameras are the same... they are "particular" in that they "have" properties and methods for cameras only.  The only logic-difference between these three node-types... is in your mind, and was likely put there when you were using one of the many inferior-to-BJS frameworks.  :o

BJS is faster, easier, and more versatile than the lesser frameworks.  You're in the big league, here.  If you reallocate the time you spend shining a bright light in the face of BJS and trying to interrogate it... to using forum and github searches so you don't ask the same questions that have already been answered 50 times, you will learn that what I say... is true.  And if you cannot cope and deal with driving the world's best webGL framework, then I suppose you will need to write your own framework or drop back down to the lesser frameworks.

BJS is not for everyone... even though it certainly is.  But we ARE a little low on girls, in my opinion.  :)

http://playground.babylonjs.com/#1XOMH0 - 45 lines of actual code.  Let's see you do that in 45 lines of code... with one of your often-referenced inferior frameworks.  I bet you can't.  Let's see what ya got.  :)

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.

Loading...
 Share

  • Recently Browsing   0 members

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