elkyu Posted August 4, 2015 Share Posted August 4, 2015 Hi ! I have that : http://www.babylonjs-playground.com/#272WDW#14 Actually the image is in the scene behind the plane (material on a plane) What I want it's put that image in html directly, behind the canvas. I currently I get all the coordinates of all points which make the hole. And with that I calculate the center of the hole to place the image there. But I don't know how we can translate the coordinate of the hole center into the html document ? Quote Link to comment Share on other sites More sharing options...
iiceman Posted August 4, 2015 Share Posted August 4, 2015 After giving that a thought I don't think it will work like that. If you place the image directly on html you cant really zoom in using babylon. You know what I mean? The camera doesnt move closer to the html. It just moves in the virtual 3D space. If the images are not in that same 3D space, I don't think you can zoom on them by moving the camera... at least that's how I imagine it Quote Link to comment Share on other sites More sharing options...
jahow Posted August 4, 2015 Share Posted August 4, 2015 So, to make this clear, you'll have to simulate the zoom effect on the image by modifying the image's attributes (position, size) along the way. Are you sure you need to mix HTML and WebGL here? I mean, once the zoom animation is over, your WebGL canvas is pretty much your image. If you're sure you're going with that, then it's just a matter of creating an img element and animation its attributes. JQuery does that easily:var img = $("<img>").appendTo("body").offset( {top: 100, left: 200} );img.animate({top: 0, left: 0}, 2.0, function() { });Edit: iiceman explains it better Quote Link to comment Share on other sites More sharing options...
elkyu Posted August 4, 2015 Author Share Posted August 4, 2015 with the solution provided in the other topic I don't need to do this, yes, but I'd still like to know how to do this , it might serve me in the future. Not necessarily to zoom in on the image.It's just for satisfy my curiosity (that's why I created an other topic) 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.