|
@@ -25,6 +25,7 @@
|
|
<script src="../src/extras/geometries/CylinderGeometry.js"></script>
|
|
<script src="../src/extras/geometries/CylinderGeometry.js"></script>
|
|
<script src="../src/extras/geometries/TorusGeometry.js"></script>
|
|
<script src="../src/extras/geometries/TorusGeometry.js"></script>
|
|
<script src="../src/extras/modifiers/SubdivisionModifier.js"></script>
|
|
<script src="../src/extras/modifiers/SubdivisionModifier.js"></script>
|
|
|
|
+ <script src="../src/extras/modifiers/ScaleModifier.js"></script>
|
|
|
|
|
|
<script src="fonts/helvetiker_regular.typeface.js"></script>
|
|
<script src="fonts/helvetiker_regular.typeface.js"></script>
|
|
|
|
|
|
@@ -79,9 +80,17 @@
|
|
|
|
|
|
{type: 'CubeGeometry', args: [ 200, 200, 200, 2, 2, 2, materials ] },
|
|
{type: 'CubeGeometry', args: [ 200, 200, 200, 2, 2, 2, materials ] },
|
|
{type: 'TorusGeometry', args: [ 100, 60, 4, 8, Math.PI*2 ] },
|
|
{type: 'TorusGeometry', args: [ 100, 60, 4, 8, Math.PI*2 ] },
|
|
- {type: 'SphereGeometry', args: [ 100, 3, 3 ] },
|
|
|
|
- {type: 'IcosahedronGeometry', args: [ 1 ], scale: 200 },
|
|
|
|
|
|
+ {type: 'TorusKnotGeometry', args: [ ], scale:0.25, meshScale:4 },
|
|
|
|
+ {type: 'SphereGeometry', args: [ 100, 3, 3 ], meshScale:2 },
|
|
|
|
+ {type: 'IcosahedronGeometry', args: [ 1 ], scale: 100, meshScale:2 },
|
|
{type: 'CylinderGeometry', args: [ 25, 75, 200, 8, 3 ]} ,
|
|
{type: 'CylinderGeometry', args: [ 25, 75, 200, 8, 3 ]} ,
|
|
|
|
+ {type: 'OctahedronGeometry', args: [200, 0], meshScale:2 },
|
|
|
|
+ {type: 'LatheGeometry', args: [ [
|
|
|
|
+ new THREE.Vector3(0,0,0),
|
|
|
|
+ new THREE.Vector3(0,50,50),
|
|
|
|
+ new THREE.Vector3(0,0,100),
|
|
|
|
+ new THREE.Vector3(0,50,150),
|
|
|
|
+ new THREE.Vector3(0,0,200) ] ]},
|
|
{type: 'TextGeometry', args: ['&', {
|
|
{type: 'TextGeometry', args: ['&', {
|
|
size: 200,
|
|
size: 200,
|
|
height: 50,
|
|
height: 50,
|
|
@@ -91,17 +100,27 @@
|
|
}]},
|
|
}]},
|
|
{type: 'PlaneGeometry', args: [ 200, 200, 4, 4 ] }
|
|
{type: 'PlaneGeometry', args: [ 200, 200, 4, 4 ] }
|
|
|
|
|
|
-
|
|
|
|
];
|
|
];
|
|
|
|
|
|
if (location.protocol !== "file:") {
|
|
if (location.protocol !== "file:") {
|
|
var loader = new THREE.JSONLoader();
|
|
var loader = new THREE.JSONLoader();
|
|
loader.load( 'obj/WaltHeadLo.js', function ( geometry ) {
|
|
loader.load( 'obj/WaltHeadLo.js', function ( geometry ) {
|
|
|
|
|
|
- geometriesParams.push({type: 'WaltHead', args: [ ], scale: 6 });
|
|
|
|
|
|
+ geometriesParams.push({type: 'WaltHead', args: [ ], meshScale: 6 });
|
|
|
|
|
|
THREE.WaltHead = function() {
|
|
THREE.WaltHead = function() {
|
|
- return geometry;
|
|
|
|
|
|
+ return THREE.GeometryUtils.clone(geometry);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var loader2 = new THREE.JSONLoader();
|
|
|
|
+ loader2.load( 'obj/Suzanne.js', function ( geometry ) {
|
|
|
|
+
|
|
|
|
+ geometriesParams.push({type: 'Suzanne', args: [ ], scale: 100, meshScale:2 });
|
|
|
|
+
|
|
|
|
+ THREE.Suzanne = function() {
|
|
|
|
+ return THREE.GeometryUtils.clone(geometry);
|
|
};
|
|
};
|
|
|
|
|
|
} );
|
|
} );
|
|
@@ -155,6 +174,12 @@
|
|
var params = geometriesParams[ geometryIndex ];
|
|
var params = geometriesParams[ geometryIndex ];
|
|
|
|
|
|
geometry = createSomething( THREE[ params.type ], params.args );
|
|
geometry = createSomething( THREE[ params.type ], params.args );
|
|
|
|
+
|
|
|
|
+ // Scale Geometry
|
|
|
|
+ if (params.scale) {
|
|
|
|
+ var scaler = new THREE.ScaleModifier( new THREE.Vector3(params.scale,params.scale,params.scale));
|
|
|
|
+ scaler.modify(geometry);
|
|
|
|
+ }
|
|
|
|
|
|
// Cloning original geometry for debuging
|
|
// Cloning original geometry for debuging
|
|
|
|
|
|
@@ -274,11 +299,11 @@
|
|
|
|
|
|
cube = new THREE.Mesh( smooth, meshmaterials );
|
|
cube = new THREE.Mesh( smooth, meshmaterials );
|
|
|
|
|
|
- var toscale = params.scale ? params.scale : 1;
|
|
|
|
-
|
|
|
|
- cube.scale.x = toscale;
|
|
|
|
- cube.scale.y = toscale;
|
|
|
|
- cube.scale.z = toscale;
|
|
|
|
|
|
+ var meshScale = params.meshScale ? params.meshScale : 1;
|
|
|
|
+
|
|
|
|
+ cube.scale.x = meshScale;
|
|
|
|
+ cube.scale.y = meshScale;
|
|
|
|
+ cube.scale.z = meshScale;
|
|
|
|
|
|
scene.add( cube );
|
|
scene.add( cube );
|
|
|
|
|