Changeset 1133897
- Timestamp:
- 04/13/2015 07:39:56 PM (11 years ago)
- Location:
- 3d-model-viewer/trunk
- Files:
-
- 2 edited
-
output.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
3d-model-viewer/trunk/output.php
r1133276 r1133897 3 3 4 4 <script> 5 5 6 stage = document.getElementById("<?php echo $id ?>"); 6 7 7 width = <?php echo $width ?>; 8 height = <?php echo $height ?>; 9 8 width = 0; 9 pWidth = "<?php echo $width ?>"; 10 if (pWidth.indexOf('%')==pWidth.length-1) { 11 width = stage.offsetWidth * parseInt(pWidth) / 100; 12 } else { 13 width = parseInt(pWidth); 14 } 15 16 height = 0; 17 pHeight = "<?php echo $height ?>"; 18 if (pHeight.indexOf('%')==pHeight.length-1) { 19 height = stage.offsetHeight * parseInt(pHeight) / 100; 20 } else { 21 height = parseInt(pHeight); 22 } 23 10 24 var scene = new THREE.Scene(); 11 25 var camera = new THREE.PerspectiveCamera( 75, width / height, 0.1, 1000 ); -
3d-model-viewer/trunk/readme.txt
r1133276 r1133897 24 24 as well as the cameras and your models position and scale. 25 25 26 For a good application example, [look here](http://openbuilds.com.mx/tienda_de_openbuilds_mexico/guia-lineal-v-slot/#) (thanks to Ronald van Arkel): 27 28 29 26 30 == Installation == 27 31 … … 31 35 32 36 * model: name of the model file in the media gallery. Mandatory. 33 * width, height: Size of the 3d stage. Optional, default is 500x300.37 * width, height: Size of the 3d stage. If in percent, then relative to the size of the div around the canvas. Optional, default is 500x300. 34 38 * background: Background color. Optional, default is "ffffff". 35 39 * opacity: Background opacity. Optional, default is 1. … … 59 63 == Changelog == 60 64 65 = 1.3 = 66 * width and size can be reltaive to the size of the div around the canvas (which in turn can be set via CSS). 67 61 68 = 1.2 = 62 69 * Performance after moving camera optimized.
Note: See TracChangeset
for help on using the changeset viewer.