|
@@ -16,6 +16,49 @@
|
|
|
The material index corresponds with the index of the material in the [page:.materials] array.
|
|
|
</div>
|
|
|
|
|
|
+ <h2>Examples</h2>
|
|
|
+ <div>
|
|
|
+ [example:webgl_animation_skinning_morph WebGL / animation / skinning / morph]<br />
|
|
|
+ [example:webgl_effects_parallaxbarrier WebGL / effect / parallaxbarrier]<br />
|
|
|
+ [example:webgl_geometry_colors_blender WebGL / geometry / colors / blender]<br />
|
|
|
+ [example:webgl_geometry_text_earcut WebGL / geometry / text / earcut]<br />
|
|
|
+ [example:webgl_geometry_text_pnltri WebGL / geometry / text / pnltri]<br />
|
|
|
+ [example:webgl_geometry_text WebGL / geometry / text]<br />
|
|
|
+ [example:webgl_loader_ctm_materials WebGL / loader / ctm / materials]<br />
|
|
|
+ [example:webgl_loader_json_blender WebGL / loader / json / blender]<br />
|
|
|
+ [example:webgl_loader_json_objconverter WebGL / loader / json / objconverter]<br />
|
|
|
+ [example:webgl_loader_mmd WebGL / loader / mmd]<br />
|
|
|
+ [example:webgl_materials_cars WebGL / materials / cars]<br />
|
|
|
+ [example:webgl_materials_lightmap WebGL / materials / lightmap]<br />
|
|
|
+ [example:webgl_materials WebGL / materials / / ]<br />
|
|
|
+ [example:webgl_nearestneighbour WebGL / nearestneighbour]<br />
|
|
|
+ [example:webgl_objects_update WebGL / objects / update]<br />
|
|
|
+ [example:webgl_panorama_cube WebGL / panorama / cube]<br />
|
|
|
+ [example:webgl_skinning_simple WebGL / skinning / simple]
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <code>
|
|
|
+ //The following will create a cube with a different material applied to each side
|
|
|
+ var materials = [
|
|
|
+
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0xff0000 ) } ), // right
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0x0000ff ) } ), // left
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0x00ff00 ) } ), // top
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0xffff00 ) } ), // bottom
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0x00ffff ) } ), // back
|
|
|
+ new THREE.MeshBasicMaterial( { color: 0xff00ff ) } ) // front
|
|
|
+
|
|
|
+ ];
|
|
|
+
|
|
|
+ var cubeSidesMaterial = new THREE.MultiMaterial( materials );
|
|
|
+
|
|
|
+ var cubeGeometry = new THREE.BoxBufferGeometry( 100, 100, 100, 1, 1, 1 );
|
|
|
+
|
|
|
+ var cubeMesh = new THREE.Mesh( cubeGeometry, cubeSidesMaterial );
|
|
|
+
|
|
|
+ scene.add( cubeMesh );
|
|
|
+ </code>
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
|
|