hit2501 Posted January 9, 2015 Share Posted January 9, 2015 Hi. I imported a model from 3ds max to .babylon and when I see it in html with Freecamera by arrows buttons I move very very slow.I tried to shrink the model in 3dsmax but not much help. How can I move faster with the arrow buttons? My code: <!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Like Reality</title> <!-- Babylon.js --> <script src="js/hand.minified-1.2.js"></script> <script src="js/cannon.js"></script> <script src="js/oimo.js"></script> <script src="js/babylon.js"></script> <style> html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; } #renderCanvas { width: 100%; height: 100%; touch-action: none; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function () { var scene = new BABYLON.Scene(engine); var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); camera.setTarget(BABYLON.Vector3.Zero()); camera.attachControl(canvas, true); var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene); light.intensity = 0.7; BABYLON.SceneLoader.ImportMesh("", "Mall2/", "02.babylon", scene, function (newMeshes) { camera.target = newMeshes[0]; }); return scene; }; var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); window.addEventListener("resize", function () { engine.resize(); }); </script></body></html>Thank you very much. Quote Link to comment Share on other sites More sharing options...
gryff Posted January 9, 2015 Share Posted January 9, 2015 Hi hit2501 Did you try changing the camera speed? Add this line in your code:camera.speed = <some value>;Default value is 1 How big are your scene objects? You could try adding a simple cube with BJS code - compare to objects in your scene. cheers, gryff Quote Link to comment Share on other sites More sharing options...
hit2501 Posted January 9, 2015 Author Share Posted January 9, 2015 Hi gryff, thank for your answer, thats what Ive been looking for, I used camera.speed = 200; and it work awesome. I compared with a plane made with BJS code, thats why I realize the model is huge. Once again thanks gryff. 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.