Changes between Version 27 and Version 28 of PythonOcc/elbow


Ignore:
Timestamp:
Dec 11, 2013, 1:54:46 PM (6 years ago)
Author:
Leon Kos
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PythonOcc/elbow

    v27 v28  
    476476}}}
    477477}}}
     478
     479V primeru dodatnih kosov je potrebno ponastaviti transformacijo in narediti
     480novo mrežo, kot je to prikazano v naslednjem delčku kode.
     481{{{
     482#!javascript
     483
     484        xformMat.identity();
     485        rotMat.identity();
     486        rotMat.rotateAboutZAxis(180);
     487        xformMat.multiply(rotMat);
     488        xformMat.translate(500, 500, 0);
     489        myMesh = new JSC3D.Mesh();
     490        myMesh.vertexBuffer = new Array( meshes[i].vertexBuffer.length);
     491        myMesh.faceNormalBuffer = new Array( meshes[i].faceNormalBuffer.length);
     492        myMesh.indexBuffer = meshes[i].indexBuffer;
     493       
     494        // transform and rewrite vertex coordinates
     495        JSC3D.Math3D.transformVectors(xformMat, meshes[i].vertexBuffer, myMesh.vertexBuffer);
     496        // transform and rewrite face normals
     497        JSC3D.Math3D.transformVectors(rotMat, meshes[i].faceNormalBuffer, myMesh.faceNormalBuffer);
     498        myMesh.setMaterial(material);
     499        myMesh.init();
     500        theScene.addChild(myMesh);
     501}}}