ozRocker Posted July 10, 2017 Share Posted July 10, 2017 With this cat, if I add the decal then it works fine, but if I rotate the cat then add the decal it will not show. How can I transform the decal so it would fit on the rotated cat? http://www.babylonjs-playground.com/#1BAPRM#100 In general, if I rotate and translate a mesh, what do I need to do to the decal position and normal to fit the rotated/translated mesh? I'm using decals on specific areas, like on a person's heart or bellybutton and I want to be able to apply that decal anytime after the mesh has moved. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 10, 2017 Share Posted July 10, 2017 This seems to be a bug! Let me fix it Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 10, 2017 Share Posted July 10, 2017 Actually after the rotation your point1 is no more valid (not on the mesh surface) regarding your second question, you can just set decal.parent = mesh and it should work Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 10, 2017 Author Share Posted July 10, 2017 so what can I do to make that decal fit on the rotated surface so it's in the same place on the cat when there is 0 rotation? Is there some kind of maths to apply to the position vector of the decal? Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 10, 2017 Author Share Posted July 10, 2017 All good! I figured it out. If I set the decal before any transformations and parent mesh to decal, then I can simply change my decal texture when I need to change decal. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted July 11, 2017 Author Share Posted July 11, 2017 Just to clarify, what I needed was a pattern on a person's t-shirt which can be changed to any image you want. That image was a decal on top of the person. I thought you had to remove the decal then create a new one in order to change the image but turns out you can keep the decal there and just change the diffuse texture. 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.