Domcallaghan Posted November 4, 2015 Share Posted November 4, 2015 Hello guys, I want to know if it's possible to use an image as a texture for a plane or a box and use a control panel to resize, move, etc the image on the plane. I suppose i have to use dynamic textures but i'm not very sure that will be the best way to have the result. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 4, 2015 Share Posted November 4, 2015 If you just want to resize the image you can use the regular texture variables (uOffset, vOffset etc'). If you want to manipulate the image somehow you will need to use a dynamic texture.What exactly do you want to do with the image? Quote Link to comment Share on other sites More sharing options...
Domcallaghan Posted November 4, 2015 Author Share Posted November 4, 2015 The goal is to put your image on a mesh and have the possibilty to choose the position, the size, the scale, etc... Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 4, 2015 Share Posted November 4, 2015 http://www.html5gamedevs.com/topic/16028-dynamic-texture-performance/?fromsearch=1Something like that? RaananW and Domcallaghan 2 Quote Link to comment Share on other sites More sharing options...
Domcallaghan Posted November 4, 2015 Author Share Posted November 4, 2015 Exactly, thanks. This topic is the chosen one for me. I will work on my project and come back if i need some more help or not. =) Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 4, 2015 Share Posted November 4, 2015 Alright, cool, good luck then! Don't forget to let us see what you created when you are done! Hint: if the playground in the other thread doesn't work, just click "Run" again. It should work, I think it's just how the fabric.js is referenced in the playground might be a little problematic. Quote Link to comment Share on other sites More sharing options...
Domcallaghan Posted November 4, 2015 Author Share Posted November 4, 2015 i use the code in example to recreate the same scene. So i took the code and i develop the script but in my localhost that doesn't work. So i put the code in the playground and suprise ! it's works. I think there are something missing in my html or js file. Here the playground link http://www.babylonjs-playground.com/#RVFJ2 Here the html code <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Babylon Cube</title> <link rel="stylesheet" href="css/style.css"> <script src="js/lib/fabric.js"></script></head><body> <canvas id="renderCanvas" class="turtle"> <canvas id="paintCanvas" style="visibility:hidden" width="1024" height="1024"></canvas> <script src="js/lib/jquery-1.10.2.min.js"></script> <script src="js/lib/babylon.2.2.js"></script> <script src="js/index2.js"></script></body></html>for the Js file, i just remove this lines $('#fabricjs').remove();$('#paintCanvas').remove();$(".canvas-container").remove();$('body').append('<script id="fabricjs" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.5.0/fabric.js"></script>');$("#canvasZone").append('<canvas id="paintCanvas" style="visibility:hidden" width="1024" height="1024"></canvas>'); Quote Link to comment Share on other sites More sharing options...
Domcallaghan Posted November 4, 2015 Author Share Posted November 4, 2015 Okay, it's was my fault, sorry. So your solution is good @iiceman. I will post a playground when i will be finished. 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.