jkidd08 Posted December 19, 2017 Share Posted December 19, 2017 I am attempting to apply a texture of a diffuse image of the Earth to a sphere and have the scene render with the Earth's north pole aligned with the body/local +Z axis. However, I can't seem to implement this. Below is a playground scenario I put together for the scene. I've attempted to achieve this with the following lines (26 - 33 of the playground scene). earthSurface.diffuseTexture.uAng = 0; earthSurface.diffuseTexture.vAng = 0; earthSurface.diffuseTexture.wAng = 0; earthSurface.diffuseTexture.uScale = 1.0; earthSurface.diffuseTexture.vScale = 1.0; earthSurface.diffuseTexture.wScale = 1.0; http://www.babylonjs-playground.com/#634KR1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 19, 2017 Share Posted December 19, 2017 Hi @jkidd08, welcome to the forum. https://www.babylonjs-playground.com/#634KR1#1 I don't know if that is what you wanted, but its a try. I didn't do any texture-shifting. Instead, in lines 39/40, I rotated the sphere, and then "baked" that rotation into the mesh. BakeCurrentTransformIntoVerticies() sort-of "naturalizes" the mesh to that orientation. Rotation, position, and scaling values get re-initialized. I hope this helps. Other forumers, with other ideas, are nearby. Stay tuned. And thx for providing a playground demo scene. Cool! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 19, 2017 Share Posted December 19, 2017 Here we are: https://www.babylonjs-playground.com/#634KR1#2 (I added a parameter to texture construction on line #23 in order to prevent the engine to invert V coordinate) BTW, @Wingnut's idea works as well but using a geometrical approach 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.