Guest Posted June 27, 2018 Share Posted June 27, 2018 Did you try the debugLayer I shown ? It clear helps debugging Quote Link to comment Share on other sites More sharing options...
DylanD Posted June 28, 2018 Author Share Posted June 28, 2018 16 hours ago, Deltakosh said: Did you try the debugLayer I shown ? It clear helps debugging Yea I have looked through it but I do not know what to look for, I've been looking for like pivot point or something. Quote Link to comment Share on other sites More sharing options...
DylanD Posted June 28, 2018 Author Share Posted June 28, 2018 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. Quote Link to comment Share on other sites More sharing options...
DylanD Posted June 28, 2018 Author Share Posted June 28, 2018 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) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 28, 2018 Share Posted June 28, 2018 Thanks to @JohnK we have an extensive doc on pivot: http://doc.babylonjs.com/how_to/pivot http://doc.babylonjs.com/how_to/pivots DylanD 1 Quote Link to comment Share on other sites More sharing options...
DylanD Posted June 28, 2018 Author Share Posted June 28, 2018 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 28, 2018 Share Posted June 28, 2018 As long as it works, this is cool. I'm a pragmatic Quote Link to comment Share on other sites More sharing options...
DylanD Posted June 28, 2018 Author Share Posted June 28, 2018 13 minutes ago, Deltakosh said: As long as it works, this is cool. I'm a pragmatic Haha yea me too a little.. Im still going to try to make this a better system, this way I need two extra meshes. Just for rotation, so I'm going to find a better way possible. GameMonetize 1 Quote 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.