chetto1983 / jsc3d

Automatically exported from code.google.com/p/jsc3d
0 stars 0 forks source link

initial zoom #122

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a model of a building with the landscape around it. 
When I open the model, the view includes the entire landscape and the building 
is too small. 
You can set the initial zoom in so that it appears the building in the 
foreground? 
my html file 

<!DOCTYPE HTML>
<HTML>
 <HEAD>
  <TITLE> JSC3D - Test </TITLE>
  <META NAME="Author" CONTENT="JSC3D">
 </HEAD>

 <BODY>

<canvas id="cv" width=640 height=480></canvas>

<script type="text/javascript" src="jsc3d.js"></script>
<script type="text/javascript" src="jsc3d.webgl.js"></script>
<script type="text/javascript">

    var viewer = new JSC3D.Viewer(document.getElementById('cv'));

    viewer.setParameter('SceneUrl',         'models/my_model.obj');
    viewer.setParameter('InitRotationX', 15);
    viewer.setParameter('InitRotationY', -45);
    viewer.setParameter('InitRotationZ', -10);
    viewer.setParameter('ModelColor',       '#CAA618');
    viewer.setParameter('BackgroundColor1', '#413839');
    //viewer.setParameter('BackgroundColor2', '#FF0000');
    viewer.setParameter('MipMapping', 'on');
    viewer.setParameter('RenderMode', 'textureflat');
    viewer.setParameter('Definition', 'high');
    viewer.setParameter('Renderer', 'webgl')
    viewer.init();
    viewer.update();

</script>
 </BODY>
</HTML>

Tanks 
Simone

Original issue reported on code.google.com by simmi...@gmail.com on 16 Oct 2014 at 10:04

GoogleCodeExporter commented 8 years ago
The initial view is automatically computed from the bounding volume of the 
whole model. It cannot be set in current implementation.  I'll consider to add 
new API to allow it zoom to a specific position given by the user.

Original comment by Humu2...@gmail.com on 16 Oct 2014 at 4:09