stormwarestudios Posted October 17, 2016 Share Posted October 17, 2016 Hello! Your first question may very well be, "Peter, what in the nine hells did you do?" and so for this I will try to explain! While building up my scene, I happened upon a situation where a mesh that I expected to be present, was absent in the rendered viewport. After visual inspection with the debugLayer, the object was truly in the scene, but simply not visible. Upon calling mesh.getAbsolutePosition(), I was shocked to see the return value of { x: NaN, y: NaN, z: NaN } What is odd about this particular situation is that the mesh is one of 10 that are generated in a loop; the others are fine and appear as expected, but my missing mesh (#3 in the list) is visually not appearing. I broke down my code to determine where this might be occurring, and it seems that, until the following call, the absolute position of the entity resolves to { x: 0, y: 0, z: 0 } (as expected)... once the call is made, the absolute position of the mesh appears as { x: NaN, y: NaN, z: NaN } ! engine.runRenderLoop(this._runRenderLoop.bind(this)); It would be difficult for me to explain in code how things are set up, so I'm hoping that someone might have encountered such a situation and be able to say, "hey, I know what in the nine hells *I* did, so here are my experiences and how I fixed it!" Regardless of the outcome, I will try to explain my solution when I come across it. Thanks for reading! - Peter Quote Link to comment Share on other sites More sharing options...
stormwarestudios Posted October 17, 2016 Author Share Posted October 17, 2016 Well... it turns out that one of the parents of the missing object had its rotation.y initialized to NaN, which trickled down after the first render to result in the NaN position, too. brianzinn and Pryme8 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 17, 2016 Share Posted October 17, 2016 Ok I prefer that Can you renamed the post to [Solved]... ? Thanks Quote Link to comment Share on other sites More sharing options...
stormwarestudios Posted October 18, 2016 Author Share Posted October 18, 2016 Solved GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted October 20, 2016 Share Posted October 20, 2016 Yeah when ever something is Nan and it should not be start logging out all the variables and calculations up to that point and make sure you have expected output at all phases. 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.