joshcamas Posted February 28, 2015 Share Posted February 28, 2015 Hello guys!!! I've been working a huge amount on my editor, (it's been like 4 months now?) and I'm actually getting somewhere! I've run into an interesting problem, however - the editor is going to have a list of meshes. When you hover over the mesh, I need a image to go along with it. How would I do this? Render a mesh and turn it into an image during runtime... I hope this makes sense! Thanks! -Josh oh, and here's a sneaky peaky of my work: :3 It's not that great but hey it's progress Wingnut, Dad72 and jerome 3 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2015 Share Posted February 28, 2015 Nice work ... your interface is very well chosen. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted February 28, 2015 Author Share Posted February 28, 2015 Thanks! I really had to put my nose to the grindstone and learn the css to do it... but it was totally worth it. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2015 Share Posted February 28, 2015 You should remove your link from your signature is dead. or to point to a demo of your editor.Google could give the black list because link not going anywhere. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 28, 2015 Share Posted February 28, 2015 Hi Josh! Good to hear from you, and congrats on your editor advancements. It looks great! HI to you, too, Dad72. Hope you guys are well. If I may clarify, you want an image of the hovered mesh, correct? Did you see the "render scene on a PNG" document... http://babylondoc.azurewebsites.net/search.php?q=Render+Scene+on+a+PNG *shrug* There might be ANOTHER option. Does it have to be an image? Maybe... onHover/onMouseOver... you could aim another BJS camera at the mesh, then render that camera viewport as a small webGL canvas Use that canvas... in place of the image. *shrug* I bet you thought about that already, though. One general hint. Never LEARN something when you can steal it and re-purpose it for your own needs. Later in life, when you become mega-lazy and your brain is badly damaged from abuse, this secret will be VERY handy. I bet you knew THAT already, too, as I think Samac began as something else, if I remember right. But you stated that right from the start, so you are clean, noble, and honorable... and a darned good trailblazer, as well. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 28, 2015 Share Posted February 28, 2015 Hi Wingnut, It interests me to have an image of the model flying over a link. Your idea is interesting Wingnut. but I think this may hurting performance this solution. The ideal is to be able to generate thumbnail images of each models from models give a bank. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 28, 2015 Share Posted February 28, 2015 nod. I think you are correct. Performance issues. When a user changes the texture or scaling of a mesh (its look), they would need/want to re-create the thumb pic. But this could be a non-automatic function. The user might need to right-click, choose 'create/recreate thumbnail'. Then a short wait, and then the thumb pic is updated/created. Then hover would only pop-up (or iconify) the image IF one has been created for that mesh. Josh didn't say if the image would happen near the mesh, or become an icon on a menu/toolbar. Maybe both, and more. Interesting topic. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted March 1, 2015 Author Share Posted March 1, 2015 Yeah, there would be many many icons. The image would be on a toolbar thingy. I was thinking of a system that merges both of your ideas, Wingnut: have a hidden babylon engine in the background that loads the mesh, creates the scene from png, and then puts it into the html.I'll try this out later! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 2, 2015 Share Posted March 2, 2015 You can do the following:- Create a camera- Position you camera to have your object in his frustum- Set your camera as scene.activeCamera- When you want to get a picture of your mesh:var texture = new RenderTargetTexture("screenShot", size, scene, false, false);texture.renderList = myMesh;texture.onAfterRender = () => { Tools.DumpFramebuffer(width, height, engine);};scene.incrementRenderId();texture.render(true);texture.dispose();if (previousCamera) { scene.activeCamera = previousCamera;}(Please note that you'll need bjs 2.1 for this to work) Dad72 1 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.