juanpenche Posted September 23, 2015 Share Posted September 23, 2015 Hi, I´m new to babylon.js and I´d like to know if anyone can tell me if is possible with this framework to view a obj (exported to .babylon with blender) , define some areas in the obj , detect a click on this area and change the texture of this area. Is there any example about this? Thanks! Quote Link to comment Share on other sites More sharing options...
juanpenche Posted September 23, 2015 Author Share Posted September 23, 2015 I answer myself: scene.onPointerDown = function (evt, pickResult) {// if the click hits the ground object, we change the impact positionif (pickResult.hit) {currentMesh = pickResult.pickedMesh;currentMesh.material=newMaterial;}}; jerome, Wingnut, GameMonetize and 1 other 4 Quote Link to comment Share on other sites More sharing options...
iiceman Posted September 24, 2015 Share Posted September 24, 2015 Well, just an idea: you could edit the model in blender and create submeshes. Then you can do it like that. If it's all just on big mesh it might not work. let us know how it is going! Jaskar 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 24, 2015 Share Posted September 24, 2015 This will change the texture of the entire object. If you want to find the spefiic point of the UV (Texture) coordinates to change the texture at this specific point you could also get them from the pickResult object.I don't remember which user in the forum showed once a wonderful demo of exactly that implementation, but it was great :-) Quote Link to comment Share on other sites More sharing options...
iiceman Posted September 24, 2015 Share Posted September 24, 2015 I remember that we had stuff like that: http://www.babylonjs-playground.com/#9U086#16 This is using the texture coordinates to paint on the texture and modify it. Not sure if that's what juanpenche want, but that might work. RaananW and Jaskar 2 Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 24, 2015 Share Posted September 24, 2015 exactly what I meant. so awesome :-) 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.