Dad72 Posted January 1, 2018 Share Posted January 1, 2018 Hello, getFrontPosition() do not see good value, because if I create an object that must be 10 units forward on the Z axis relative to the camera's position that is a -10, the object should be at position 0 on the Z axis and should not move on the Y axis. Now the object has moved 18 units in front on the Z axis and has dropped 13 units on the Y axis. Something is not good. I realize that this bug has existed for a long time. PG here : http://www.babylonjs-playground.com/#3JX5U2#2 Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 2, 2018 Share Posted January 2, 2018 There was two issues: - camera's target is by default on 0,0,0. In your case you want to set it up to 0,7,0 -Because no rendering occured, you need to force the camera to have its value updated manually with camera.getWorldmatrix() https://www.babylonjs-playground.com/#3JX5U2#3 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 2, 2018 Author Share Posted January 2, 2018 Why not add camera.getWorldmatrix () in getFrontPosition () Otherwise I have to use camera.getWorldmatrix() as soon as we create a camera for each project. Thanks DK Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 2, 2018 Share Posted January 2, 2018 Because if you are doing it after at least one rendering you don't need it anymore But you are right: it is not obvious! I'll fix it for next commit Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 2, 2018 Author Share Posted January 2, 2018 Yes I understand, thanks for fixing it. And for this bug, is there a possible repair ? http://www.html5gamedevs.com/topic/34802-impostor-bigger-than-the-mesh-after-scaling/?do=findComment&comment=200086 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.