darcome Posted November 5, 2014 Share Posted November 5, 2014 Hello everyone! As you can see here, http://ludem.net/babylon/index.html there's a little demo with all the features I need right now from BabylonJS... For example, you can click on an element in the 3d scene or in the table on the right, and it becomes selected, both in 3d and in the table... My question is... how much can i "zoom" to the selected mesh and keep it into view? I mean, I want very vertice of the mesh visible... Thank you in advance! P.S: If you have some tips about my code, don't hesitate to tell me! (Everything is in the index.html code) or general comments! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 6, 2014 Share Posted November 6, 2014 Tadammmm! I've just published just for you a new function mesh.isCompletelyInFrustum(). So you can zoom as long as this function returns true Quote Link to comment Share on other sites More sharing options...
darcome Posted November 6, 2014 Author Share Posted November 6, 2014 I'm sorry for the stupid question... but where i can find it? In the 2.0 alpha? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 6, 2014 Share Posted November 6, 2014 Yes, alpha 2.0 Quote Link to comment Share on other sites More sharing options...
darcome Posted November 6, 2014 Author Share Posted November 6, 2014 Thank you! I'll try it asap! Quote Link to comment Share on other sites More sharing options...
darcome Posted November 6, 2014 Author Share Posted November 6, 2014 Hello Deltakosh, I have a question about the function you created... 1) Where do I have to use it? From what I understand, I should use it in the scene.registerBeforeRender and if the function returns false, i call the .stop () function on the animatable returned by the scene.beginAnimation... But doing so, I'd have, for every frame, an if that evaluates the mesh, even if there is no mesh to evalutate because I am not animating anything... I mean, something like this:if (mesh != null) if (mesh.isCompletelyInFrustum () == false) animatable.stop ();Do you think would be possible to add a callback in the Animation like .onTick () that if returns false, stops the animation? Or there are other ways? 2) Can I pass an array of meshes to the function, or only one? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 7, 2014 Share Posted November 7, 2014 1/ onTick would do exactly the same as checking during onBeforeRender so what you are doing is great2/ You have to enumerate with a "for" 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.