hit2501 Posted March 22, 2015 Share Posted March 22, 2015 Hi. I have a simple babylon model animation (rotating sphere with images) I dont know how can I put that animation on a html form to see only the sphere (without a square background). Anybody knows how to do this? Thank you all. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 22, 2015 Share Posted March 22, 2015 Do you mean a transparent background ? The scene is cleared each frame with scene.clearColor() which is given a Color3 argument.Don't know if we can pass an alpha or a Color4 instead ... The html canvas element can be cleared with a transparent color of course. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted March 22, 2015 Author Share Posted March 22, 2015 yes, like a .png Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 22, 2015 Share Posted March 22, 2015 Hi! http://playground.babylonjs.com/#1TZI08#3 lines 6-12 Crap, ya beat me to it, Jerome. My quick-draw is not so quick anymore, these days. jerome 1 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted March 22, 2015 Author Share Posted March 22, 2015 Thank you Wingnut but this change the background and texts are above all (even the canvas). now I'm trying to insert the sphere (with no background) in the area to the right of the texts "sign up" and "sign in" you can see here:http://www.wilawara.com/likereality.html thanks again Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 22, 2015 Share Posted March 22, 2015 Like this? http://urbanproductions.com/wingy/babylon/hit2501_fun/fun.htm That should do the trick, eh? I was lazy and used absolute positioning - a cop-out compared to tables and CSS fixed-right magic, etc. But I DID use percentages for canvas placement and sizing - a wise thing in my opinion... for good window resizing. There's probably better ways, but, I'll let you figure those out. Just view the source of that page... grab whatever you need. Do people really use <font> elements these days? I think someone needs to brush-up on their html/css skills. Ahem. hit2501 and jerome 2 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted March 22, 2015 Author Share Posted March 22, 2015 Awesome, thank you very much Wingnut It is true, Im newbie with css and html but with time I will learn more. Thanks for the advice. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 22, 2015 Share Posted March 22, 2015 My pleasure... I'm glad that worked for your needs. It's none of my business... but... can I ask what part of the world you live-in? (only if you want to tell). Just... general area is fine... no need for gps coords. By the way, those 3 boxes are dark on the bottom... due to the way a hemisphericLight works. A single up-aiming hemi light can light-up all sides of a scene... except the bottom. To make a hemi light illuminate the bottom of the boxes... light.groundColor = new BABYLON.Color3(0.3, 0.3, 0.3); // low powered gray light Increase those numbers or color them as wanted, of course. See the new BABYLON.Vector3(0, 1, 0) in the hemisphericLight constructor? That is a "direction" and not a location. That is saying... make this light shine in a straight-upward direction... and then the sky bounces the light back down to the scene. So, now you see... that the .groundColor lighting... actually aims in the same direction as the hemi's main light direction. In this case, both (hemi bulbs) aim up. Weird, eh? (yawn) All in all, the hemi light works great... it's my favorite. HemisphericLights are the only light type that uses a .groundColor property. Our other 3 light-types don't need it, because they don't work as hard as the hemi light works. Be well! Quote Link to comment Share on other sites More sharing options...
hit2501 Posted March 22, 2015 Author Share Posted March 22, 2015 No problem, I'm from La Paz Bolivia. The lights looks great but I will review the other options. Do you think there is no problem if I use an animation imported from Blender? Greetings from Bolivia! GameMonetize and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 23, 2015 Share Posted March 23, 2015 Hi I think you have another thread that talks about Blender animations, right? Besides... I have zero experience in that, but... you might want to go here or use the standard forum search... and search for... blender animation (maybe do it with quotes around it) There's lots of people talking about Blender animations. Be well. 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.