zeng Posted November 28, 2017 Share Posted November 28, 2017 mesh.lookAt I want to get x, y, z after rotation What should I do? Mesh.rotation.x gets null Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 28, 2017 Share Posted November 28, 2017 lookAt sets the rotationQuaternion, if set. are you sure it was not set before?https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.transformNode.ts#L344 Quote Link to comment Share on other sites More sharing options...
zeng Posted November 28, 2017 Author Share Posted November 28, 2017 1 hour ago, brianzinn said: lookAt sets the rotationQuaternion, if set. are you sure it was not set before?https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.transformNode.ts#L344 Thank you, I think I should see more of the source code Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 28, 2017 Share Posted November 28, 2017 The main thing is to learn the difference between the properties 'rotation' and 'rotationQuaternion'. Only one is used at a time. Did you find what you needed on mesh.rotationQuaternion? Quote Link to comment Share on other sites More sharing options...
adam Posted November 28, 2017 Share Posted November 28, 2017 Make sure you are using the latest build. Sebavan made an improvement to lookAt last night so that it won't force you to use rotationQuaternion. https://github.com/BabylonJS/Babylon.js/commit/e76375739fb2ef1677133c5aae53b9dc39fa1911#diff-983b827a9015f6f47381e6fd7a172ca7R356 Quote Link to comment Share on other sites More sharing options...
zeng Posted November 29, 2017 Author Share Posted November 29, 2017 18 hours ago, brianzinn said: 主要的是要了解属性“旋转”和“旋转Quanternion”之间的区别。一次只能使用一个。你有没有找到你所需要的mesh.rotationQuaternion? Yes, I found what I wanted,thank you... brianzinn 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.