Jump to content

Faster camera or decrease model size...


hit2501
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...