freetoplay Posted May 11, 2018 Share Posted May 11, 2018 Hi, I am playing around with the Viewer, but when I load models, everything appears really zoomed in. I am using this code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>BabylonJS Viewer - Basic usage</title> <style> babylon { width: 100%; height: 600px; } </style> </head> <body> <babylon model="./character.glb"></babylon> <script src="https://viewer.babylonjs.com/viewer.min.js"></script> </body> </html> Do I have to manually adjust the camera to zoom out? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 14, 2018 Share Posted May 14, 2018 pinging @RaananW Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 14, 2018 Share Posted May 14, 2018 First viewer question! awesome! The simplest solution for this is to normalize the model. This will keep the model in perspective while making sure the camera's zoom factors. Try this: <babylon model.normalize="true" model.url="./character.glb"></babylon> You can also set the scaling of the model if you want: <babylon> <model url="./character.glb"> <scaling x="10" y="10" z="10"></scaling> </model> </babylon> You can also use the "extended" configuration, which adds a lot of configuration elements, including light, camera configuration and behaviors, better PBR support, environment definitions and more. to use that do this: <babylon extends="extended" model="./character.glb"></babylon> Let me know if this helped! Quote Link to comment Share on other sites More sharing options...
freetoplay Posted May 15, 2018 Author Share Posted May 15, 2018 @RaananW That works as expected! Thanks! RaananW 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted May 15, 2018 Share Posted May 15, 2018 awesome. what have you used at the end? Quote Link to comment Share on other sites More sharing options...
freetoplay Posted May 16, 2018 Author Share Posted May 16, 2018 I ended up using model.normalize="true" GameMonetize 1 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.