moreAPI Posted December 3, 2015 Share Posted December 3, 2015 Hello everyone, i'm trying to use mesh.renderOutline = true to get an outline on an object which has been scaled in one direction. But instead i get a floating plane in this direction. I guess the outline is made by inserting planes under the faces of the mesh and letting the edges "stick out" and there is some problem with scaling of the target mesh. Here an example in pg:http://www.babylonjs-playground.com/#1KJG6O#1 I hope someone can help me. A workaround would be to create every time i want to scale my box a new box with the right dimensions. But as the scaling may happen every frame i suppose this would not be good idea. Thanks and Greetings,moreAPI Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 3, 2015 Share Posted December 3, 2015 Hello Welcome on this forum! The outline is done by retrieving the vertex positions of the mesh. Scaling a mesh does not update these positions. However, you can do something like this: http://www.babylonjs-playground.com/#1KJG6O#3 Be careful, bakeCurrentTransformIntoVertices will *reset* your mesh scaling to 1 by updating its vertice positions. It also do the same for position and rotation, and may generated side-effects.I think it's more of a workaround than a fix to your problem, but it's not that easy to fix directly in the engine. Hope that help though ! Cheers! moreAPI 1 Quote Link to comment Share on other sites More sharing options...
moreAPI Posted December 4, 2015 Author Share Posted December 4, 2015 After i realized that bakeCurrentTransformIntoVertices() works on World coordinates, I temporarily detach the object from it's parent and everything works as expected. My Problem is solved.Thank you for your fast response. Greetings,MoreAPI Quote Link to comment Share on other sites More sharing options...
Temechon Posted December 4, 2015 Share Posted December 4, 2015 My pleasure 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.