Pawel W Posted October 3, 2014 Share Posted October 3, 2014 Hello there, I'm trying to create placeholder editor (svg), where users can edit photo on the left and they get 3d preview of it on the right.So far so good, but I'm having problems with texturing mesh. Here is a screen how it looks:Model I use: https://www.dropbox.com/s/iaxrakz0a5knu1o/cup_v2.blend?dl=0And function how I update texture: //get texture url and create material:var textureUrl = "http://localhost/FotoEditor/app/php/" + response +"?"+new Date().getTime(); var materialTest = new BABYLON.StandardMaterial("texture", $scope.babylon.sceneVars.scene); materialTest.diffuseTexture = new BABYLON.Texture(textureUrl, $scope.babylon.sceneVars.scene); //scale it somehow, dont know is it good or not, but without it texture is strongly zoomed:materialTest.diffuseTexture.uScale = 5; materialTest.diffuseTexture.vScale = 5; //assign material to mesh:$scope.babylon.sceneVars.scene.meshes[0].material = materialTest; Issues:1. Why is texture initially rotated? Object is in 0,0,0 position and it's not turned around...2. Is there any way I can make sure proportions from what user create on the left are exact on 3d model? In SVG users create in editor on the left I have all dimensions I need, but I'm not sure how can i connect them with those on 3d model (model is created in blender with metrics dimensions)3. How can I turn off texture repetition? If user pan out image it should not repeat on 3d object and leave white space instead. Quote Link to comment Share on other sites More sharing options...
gryff Posted October 3, 2014 Share Posted October 3, 2014 Hi Pawel How can I turn off texture repetition? If user pan out image it should not repeat on 3d object and leave white space instead. I took a look at your blend file and the UV map for the "placeholder" object (what appears to be the label). Your map is marked A below. Try remapping the UVs so that they look like B in image below. cheers, gryff Quote Link to comment Share on other sites More sharing options...
Pawel W Posted October 6, 2014 Author Share Posted October 6, 2014 Thank you, took me a while to edit this uv map (also, had to rotate it), but it got the work done! 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.