javascript - Thingiview and Three.js script conflict -
i have problem three.js , thingiview.js (that come three.js). have conflict 2 libraries/scripts. (i think three.js , three.min.js files). here can have 50% of scripts :s
what want showing scene thingiview , calculate boundingbox three.js.
i hope know solution kind of conflict. have passed day on :(
here code call:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/cfinstall.min.js"></script> <script src="thingview/javascripts/three.js"></script> <script src="thingview/javascripts/thingiview.js"></script> <script> var modele = document.getelementbyid('modele3d').value; window.onload = function() { // may want place these lines inside onload handler cfinstall.check({ mode: "inline", // default node: "prompt" }); thingiurlbase = ""; thingiview = new thingiview("viewer"); thingiview.setobjectcolor('#e4e5e6'); thingiview.initscene(); thingiview.loadstl('../../images/'+modele); log(thingiview.objectcolor); } </script> <div id="viewer" style="width:400px;height:300px;margin:auto;position:relative;border:5px solid white;border-radius:5px;"></div> <script src="scripts/three.min.js"></script> <script src="three/js/loaders/stlloader.js"></script> <script src="three/js/detector.js"></script> <script> var loader = new three.stlloader(); loader.addeventlistener( 'load', function ( event ) { var geometry = event.content; var material = new three.meshlambertmaterial( { color: 0xd0d1d2, shininess: 5 } ); var mesh = new three.mesh(geometry, material ); // recherche et envoi des tailles // geometry.computeboundingbox(); var largeur = (mesh.geometry.boundingbox.max.x)- (mesh.geometry.boundingbox.min.x); var hauteur = (mesh.geometry.boundingbox.max.y)-(mesh.geometry.boundingbox.min.y); var profondeur = (mesh.geometry.boundingbox.max.z)-(mesh.geometry.boundingbox.min.z); var tailles = largeur + " " + hauteur + " " + profondeur; var prix = document.getelementbyid('prototype_prix').value; if(prix==0){ document.getelementbyid('prototype_taille1').value = (math.round(largeur*100))/100; document.getelementbyid('prototype_taille2').value = (math.round(hauteur*100))/100; document.getelementbyid('prototype_taille3').value = (math.round(profondeur*100))/100; document.getelementbyid('prototype_taille1_base').value = largeur; document.getelementbyid('prototype_taille2_base').value = hauteur; document.getelementbyid('prototype_taille3_base').value = profondeur; } } ); loader.load( 'images/'+modele); </script>
Comments
Post a Comment