Changes between Version 25 and Version 26 of PythonOcc/elbow


Ignore:
Timestamp:
Dec 10, 2013, 3:10:13 AM (7 years ago)
Author:
Leon Kos
Comment:

Postavi velikost kanvasa

Legend:

Unmodified
Added
Removed
Modified
  • PythonOcc/elbow

    v25 v26  
    266266  var viewer = new JSC3D.Viewer(canvas);
    267267  viewer.setParameter('SceneUrl', '/vaje/raw-attachment/wiki/PythonOcc/elbow/elbow.stl');
    268   viewer.setParameter('RenderMode', 'smooth');
    269   //viewer.setParameter('CreaseAngle', 120);
    270268  viewer.init();
    271269  viewer.update();
     
    298296[http://code.google.com/p/jsc3d/wiki/GettingStarted osnovnem primeru] jsc3d.
    299297
    300 == Sestavljanje, meteriali, transformacije ==
     298== Sestavljanje, materiali, transformacije ==
    301299{{{
    302300#!html
    303301<script src="/vaje/raw-attachment/wiki/PythonOcc/elbow/jsc3d.min.js"></script>
    304 <script src="/vaje/raw-attachment/wiki/PythonOcc/elbow/jsc3d.touch.js​"></script>
    305302<script type="text/javascript">
    306303function onLoad2(){
    307304  var canvas = document.getElementById('cv2');
     305  canvas.width = 0.9*window.innerWidth;
     306  canvas.height = canvas.width/1.6;
    308307  var viewer = new JSC3D.Viewer(canvas);
    309308  //viewer.setParameter('SceneUrl', '/vaje/raw-attachment/wiki/PythonOcc/elbow/pipe.stl');
     
    313312  viewer.setParameter('InitRotationY', 30);
    314313  viewer.setParameter('InitRotationZ', 30);
    315 
    316314  viewer.init();
    317315 
     
    319317  var totalParts = 2;
    320318  var numOfLoaded = 0; 
     319
    321320  var onPipeLoaded = function(scene) {
    322321  var meshes = scene.getChildren();
     
    335334    for (var i=0; i<meshes.length; i++) {
    336335        material =  new JSC3D.Material();
    337         material.diffuseColor = 0xcaa618;
    338         material.transparency = 0;
     336        material.diffuseColor = 0x0ab610;
     337        material.transparency = 0.4;
    339338        meshes[i].setMaterial(material);
    340339        theScene.addChild(meshes[i]);
     
    377376</script> 
    378377<canvas id="cv2" width="600" height="400"
    379   style="background:lightgrey; border: 1px solid; float:right;" ></canvas>
    380 }}}
     378  style="background:lightgrey; border: 1px solid; float:center;" ></canvas>
     379}}}
     380{{{
     381#!javascript
     382
     383}}}