Jump to content

imported blender .babylon mesh/scene axis' off


DylanD
 Share

Recommended Posts

17 hours ago, Deltakosh said:

Did you try the debugLayer I shown ? It clear helps debugging

So if I choose the imported mesh that I want to rotate then I click the wrench, it shows the x,y,z axis' for that mesh to be off the mesh.  I think this is what dbawel was talking about fixing but I couldn't figure out.

 

It also seems as though the axis' of that mesh are just points since they don't really have length that I can tell.  if they do the length is small.

It also looks like the Y and Z axis' are switched with each, like they would have been in blender.  Yet when I rotate around the y or z it rotates around the y non matter what... well the up down axis...

 

rotation isNonUniform is true... but thats read only.

 

 

Link to comment
Share on other sites

Using 

            meshes[0].setPivotMatrix(BABYLON.Matrix.Translation(-1, -1, -1));

did not seem to change where the object pivots relative to itself but relative to the world.

if I use:

                meshes[0].rotate(BABYLON.Axis.Z,1,BABYLON.Space.BONE);

or

                meshes[0].rotate(BABYLON.Axis.Z,1,BABYLON.Space.WORLD);

It will actually rotate around a Z axis, but If I use:

                meshes[0].rotate(BABYLON.Axis.Z,1,BABYLON.Space.LOCAL);

It does not rotate about a Z axis, it rotates about a Y axis (still not at its centre, off to the side)

 

Link to comment
Share on other sites

Thanks for all the help guys!

But I figured out my own "hacky" way...

https://www.babylonjs-playground.com/#LJPRIN#8

Heres how I did it, 

Assume the red cube is the trouble, the meshes[0] that has its pivot point off its actual mesh.  So then I make another cube(called sphere) and I put that cube on the position of the redCube.  So we have two cubes one cube is red and the other is grey and not touching the red one.  then I set a cube to when the actual mesh seems to be and make it the parent of the grey cube, and I make the grey cube the parent of the redCube (not sure why I couldn't just use one cube and make it the parent...).  Then I rotate the green cube and it make the grey cube orbit it(kinda).  This makes the redCube Turn since its origin point it moving. 

 

I think, point is it works...

 

I will still look into this docs to see if there is a better way to do it.

 

Thanks everyone,

DD

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