Raitch Posted November 23, 2016 Share Posted November 23, 2016 I'm currently testing things with decals, however my entire stage in on a widen out sphere with `.scaling = new BABYLON.Vector3(25, 1, 25)`. But it seems as if decals are being treated like my sphere was never scaled; they wrap around a round sphere instead of the stretched one. I confirmed the behavior that if you select the box, the decal goes beneath the sphere: http://www.babylonjs-playground.com/#PSKRF#8 So basically do you have any suggestions on how I can tackle my issue? I have considered these approaches: * Replace the sphere with a very similar heightMap. heightMaps can be scaled and decals respect that. However I would prefer not using heightMap for a sphere issue as of now. * Maybe I need to make Babylon get that I scaled the sphere more than just setting .scaling? * Try some wonky texture placing on sphere which I think will be a lot of work Could be something I'm missing as of now which I would gladly get told. Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 23, 2016 Share Posted November 23, 2016 Scaling can often cause problems (or least I have found it so). Rather than using scaling create your sphere using MeshBuilder. This way your sphere is set at the correct sizes when created. http://www.babylonjs-playground.com/#PSKRF#9 Not sure if I got my sizes right in the PG but you get the idea. Raitch 1 Quote Link to comment Share on other sites More sharing options...
Raitch Posted November 23, 2016 Author Share Posted November 23, 2016 Nice! That made it work a whole lot better is it possible to shrink that sphere only on X and Z on renderloop with the decal adjusting? Or do I need to generate a new sphere and decal each frame? Not sure if that's costly or not. 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.