Pawel W Posted October 2, 2014 Share Posted October 2, 2014 Hello, Can someone please help me with setting correct model/scene for small scale object from Blender? I'm trying to create 3d-product preview for image html5 image editor (the idea is so user can edit canvas on the left, and it gets updated on the right babylon 3d scene, and the products must be real world size). The problem is that imported scene is realy small - object is very tiny, and zooming it creates too much movement Object is just a simple cup and is ~ 15cm x 9 cm x 9cm. You can check it - here is blender model:https://www.dropbox.com/s/rj6bn142dkv4v6j/cup.blend?dl=0 Function I use to display scene: BABYLON.SceneLoader.Load("", "images/CUP/source/cup.babylon", this.sceneVars.engine, function (newScene) { newScene.executeWhenReady(function () { $scope.babylon.sceneVars.scene = newScene; var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 1, new BABYLON.Vector3(0, 1, 0), newScene); newScene.activeCamera = camera; newScene.activeCamera.attachControl($scope.babylon.sceneVars.canvas); newScene.clearColor = new BABYLON.Color4(1,0,0,0); $scope.babylon.sceneVars.engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { }); Is there something wrong with camera position, or maybe with blender model? Quote Link to comment Share on other sites More sharing options...
AlexB Posted October 2, 2014 Share Posted October 2, 2014 Yes, your cup is very small in Blender. But you can either try scaling up the model and testing again, or else simply move your camera closer in code. Also, to make things easy on you for coding, perhaps move the cup so it sits at 0,0,0 on the stage? Quote Link to comment Share on other sites More sharing options...
Pawel W Posted October 3, 2014 Author Share Posted October 3, 2014 Thank you! I've put camera inside blender reallly close (almost covers the object), then set object's position to 0,0,0 rendered object and it worked!I also had to change wheel precision and angular sensibility to fit small object. For those who get similar problems, here is my babylon camera params: var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, 1.0, 0.2, new BABYLON.Vector3(0, 0, 0), newScene);camera.angularSensibility = 700;camera.wheelPrecision = 300; Now cup is rendered properly and has real world dimensions I'm having some problems with texturing mesh, but that is another subject I guess.Thanks again! 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.