satguru Posted January 24, 2016 Share Posted January 24, 2016 see the playground link at bottom In this I have a basic scene with one sphere Before the scene is rendered the sphere y position is set to 1. (location is thus (0,1,0)) I calculate the TransformCoordinates of Vector3(0,1,0) in the sphere's matrix. If should be (0,2,0) but when printed out to console it shows (0,1,0) The scene is then rendered, I print it out again post render. Now it shows the correct value of (0,2,0). Nothing changed between pre and post render. So why this behavior? http://www.babylonjs-playground.com/#10O0LF#0 Hartha 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2016 Share Posted January 24, 2016 Yep this is expected. WorldMatrices are only computed on demand by the renderer If you want it computed before, just call mes.computeWorldMatrix(true): http://www.babylonjs-playground.com/#10O0LF#1 Hartha 1 Quote Link to comment Share on other sites More sharing options...
satguru Posted January 24, 2016 Author Share Posted January 24, 2016 Nice. I am assuming that there is an overhead to using the "computeWorldMatrix(true)" function. How much of an overhead is this ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 24, 2016 Share Posted January 24, 2016 Really low..and everything is cached so doing it manually will prevent the recompute by the renderer Quote Link to comment Share on other sites More sharing options...
satguru Posted January 24, 2016 Author Share Posted January 24, 2016 Great. Thanks 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.