benoit-1842 Posted January 29, 2015 Share Posted January 29, 2015 Hi everybody.... I have a model that loads perfectly in my browser. Now I need to duplicate that model because I need a front and side view.. Is it easier to clone the model with animation or to have a separate window you think.... and if it's a separate window how can you do that ? Merci, Benoit Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 29, 2015 Share Posted January 29, 2015 I guess what you want to use depends on what exactly you want to do with it in the end. About multi views:http://babylondoc.azurewebsites.net/page.php?p=22461 // offical documentationhttp://pixelcodr.com/tutos/shooter/shooter.html // example implementation from the docs where it is used for a mini maphttp://www.html5gamedevs.com/topic/5204-a-problem-with-multi-viewport-screen-layout-positions/ // extensive discussion with example http://jsfiddle.net/garidan/zbgkq8nr/6/ // another fiddle I just found that demonstrates the multiple view ports..you can drag the objects to see them move in all view ports(found in this thread: http://www.html5gamedevs.com/topic/5973-multiple-viewport-issues/page-3) And if that's all too complex to get you started I made a very basic playground example just for you: http://www.babylonjs-playground.com/#W690S GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 Thank you Iceman you are very cool..... Merci, Benoit Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 Now I am running on a new problem : how I can load a .babylon file that I made with Blender with two views ? I have made working with the meshes but I don't what's the syntax structure with a .babylon file that I have build with Blender.... Merci Benoit Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 For example I don't know why the script below doesn't load..... Merci !!!! I am struggling and learning !!!!! Benoit https://drive.google.com/file/d/0B_ZBy6q5jS8xSmtTZ25FNm9PMXc/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 30, 2015 Share Posted January 30, 2015 If you want to load just a mesh and not a whole scene you can basically do it like this:BABYLON.SceneLoader.ImportMesh("spaceship", "Scenes/SpaceDek/", "SpaceDek.babylon", scene, function (newMeshes, particleSystems) { // do something here as soon as the mesh is loaded});.... the first parameter here - "spaceship" - is also the name of the mesh that you want to import in your Blender scene. Source: http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx // here is also explained how to load a whole scene and what to look out for If you can't get it to work maybe just try it out at the Babylon Sandbox: http://www.babylonjs.com/sandbox/ If it works there it should work in your code, too, somehow. Let us know if there are problems or something you don't understand. Good luck! Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 I will give you my .babylon file so you can see if it's working..... This thing isn't that easy for me !!!!! But I am learning.... Because my model that I did in Blender run well in the sandbox.... But I am unable to run it in wamp (localhost) with the two viewports.... Merci beaucoup, Benoit https://drive.google.com/a/physmodo.com/file/d/0B6PrQ0hnuh0AZFlfNEdHSVZBLUk/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 For example why this code doesn't run.... I don't understand..... It should be !!! Thanx for checking, Benoit This sharing will work for everybody... https://drive.google.com/file/d/0B_ZBy6q5jS8xYzBSbnVuYW9jOFU/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 And here's the .babylon scene (but it's a model) created in Blender sorry I put the file in the wrong gmail Merci !!! https://drive.google.com/file/d/0B_ZBy6q5jS8xOE1xNndzcWZ2d0k/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 I am not sure if the viewport feature is working with a .babylon file created with Blender....... Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 30, 2015 Share Posted January 30, 2015 I am pretty sure it is, because there should be no difference what you display. I am gonna take a look as soon as I get home tonight. Don't worry, we'll fix that somehow Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted January 30, 2015 Author Share Posted January 30, 2015 Thanx, your a cool guy !!!!! There's so much help in that forum, that's unbelieeeeevable..... Merci, Benoit Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 31, 2015 Share Posted January 31, 2015 I didn't get a chance to use my PC last night so ... sorry for the delay. I played around with it a bit and I think I got what you want: http://p215008.mittwaldserver.info/viewPorts/ It took me a while, too and I can't really tell you what the difference between yours and mine is. You have to compare yourself. I can just tell you what I did to get it working The code is actually quite short, so I post it here:var canvas = document.getElementById("renderCanvas");var engine = new BABYLON.Engine(canvas, true);BABYLON.SceneLoader.Load("", "models/Mannequin6animation.babylon", engine, function (newScene) { newScene.executeWhenReady(function () { // Camera 1 (right side) var camera1 = new BABYLON.ArcRotateCamera("camera1", 0, Math.PI/2, 20, new BABYLON.Vector3(0,7,0), newScene); newScene.activeCameras.push(camera1); // Camera 2 (left side) var camera2 = new BABYLON.ArcRotateCamera("camera2", -Math.PI/2, Math.PI/2, 20, new BABYLON.Vector3(0,7,0), newScene); newScene.activeCameras.push(camera2); // Viewports camera1.viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0); // right camera2.viewport = new BABYLON.Viewport(0.0, 0, 0.5, 1.0); // left // Camera control camera2.attachControl(canvas, true); // Animation var skeleton = newScene.getSkeletonById(0); newScene.beginAnimation(skeleton, 1, 50, true, 1); engine.runRenderLoop(function () { newScene.render(); }); });});window.addEventListener("resize", function () { engine.resize();});I guess there is no big explanation needed. If you have a question about something just ask Good luck with it, I hope it will work for you! jerome and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
benoit-1842 Posted February 5, 2015 Author Share Posted February 5, 2015 Thank you a lot Iceman you are very cool !!!! It's working great..... I will study your pipeline... Merci beaucoup, Benoit 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.