提交 59de7d60 编写于 作者: M Mugen87

refactor materials in examples

上级 8ab45291
......@@ -71,7 +71,7 @@
light.position.set( - 500, - 500, - 500 );
scene.add( light );
sphere = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 10 ), new THREE.MeshLambertMaterial( { shading: THREE.FlatShading } ) );
sphere = new THREE.Mesh( new THREE.SphereGeometry( 200, 20, 10 ), new THREE.MeshLambertMaterial() );
scene.add( sphere );
// Plane
......
......@@ -74,7 +74,7 @@
// Cubes
var geometry = new THREE.BoxGeometry( 50, 50, 50 );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
for ( var i = 0; i < 100; i ++ ) {
......
......@@ -143,7 +143,7 @@
// Cubes
var geometry = new THREE.BoxGeometry( 50, 50, 50 );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
for ( var i = 0; i < 100; i ++ ) {
......
......@@ -94,7 +94,7 @@
loader = new THREE.JSONLoader();
loader.load( 'obj/WaltHeadLo.js', function ( geometry ) {
mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } ) );
mesh = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } ) );
scene.add( mesh );
} );
......
......@@ -69,7 +69,7 @@
// Spheres
geometry = new THREE.SphereGeometry( 100, 26, 18 );
material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
for ( var i = 0; i < 20; i ++ ) {
......
......@@ -42,7 +42,7 @@
var camera, scene, canvasRenderer, webglRenderer;
var mesh, zmesh, geometry;
var mesh, zmesh, geometry, material;
var directionalLight, pointLight;
......@@ -70,8 +70,8 @@
// Spheres
var geometry = new THREE.SphereGeometry( 100, 16, 8 );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5 } );
geometry = new THREE.SphereGeometry( 100, 16, 8 );
material = new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: 0.5, shininess: 0 } );
for ( var i = 0; i < 30; i ++ ) {
......@@ -86,8 +86,7 @@
// Torus
var geometry = new THREE.TorusGeometry( 100, 25, 15, 30 );
var material = new THREE.MeshLambertMaterial( { color: 0xffffff, overdraw: 0.5 } );
geometry = new THREE.TorusGeometry( 100, 25, 15, 30 );
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
......@@ -108,9 +107,9 @@
pointLight = new THREE.PointLight( 0xffaa00 );
scene.add( pointLight );
var geometry = new THREE.SphereGeometry( 100, 8, 4 );
var material = new THREE.MeshBasicMaterial( { color: 0xffaa00 } );
var mesh = new THREE.Mesh( geometry, material );
geometry = new THREE.SphereGeometry( 100, 8, 4 );
material = new THREE.MeshBasicMaterial( { color: 0xffaa00 } );
mesh = new THREE.Mesh( geometry, material );
mesh.scale.set( 0.05, 0.05, 0.05 );
pointLight.add( mesh );
......
......@@ -88,9 +88,9 @@
var sphere = new THREE.SphereGeometry( 20, 32, 16 );
material_sphere1 = new THREE.MeshLambertMaterial( { color: 0xffaa00, shading: THREE.FlatShading } );
material_sphere2 = new THREE.MeshLambertMaterial( { color: 0xff2200, shading: THREE.FlatShading } );
material_sphere3 = new THREE.MeshLambertMaterial( { color: 0x6622aa, shading: THREE.FlatShading } );
material_sphere1 = new THREE.MeshPhongMaterial( { color: 0xffaa00, shading: THREE.FlatShading, shininess: 0 } );
material_sphere2 = new THREE.MeshPhongMaterial( { color: 0xff2200, shading: THREE.FlatShading, shininess: 0 } );
material_sphere3 = new THREE.MeshPhongMaterial( { color: 0x6622aa, shading: THREE.FlatShading, shininess: 0 } );
// sound spheres
......
......@@ -151,7 +151,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } )
];
......
......@@ -86,7 +86,7 @@
var geometry = new THREE.Geometry(),
pickingGeometry = new THREE.Geometry(),
pickingMaterial = new THREE.MeshBasicMaterial( { vertexColors: THREE.VertexColors } ),
defaultMaterial = new THREE.MeshLambertMaterial({ color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } );
defaultMaterial = new THREE.MeshPhongMaterial({ color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } );
function applyVertexColors( g, c ) {
......
......@@ -130,7 +130,7 @@
// MATERIALS
var groundMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture } );
var objectMaterial = new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0xffffff, map: texture2 } );
var objectMaterial = new THREE.MeshStandardMaterial( { color: 0x000000, map: texture2, roughness: 0.2, metalness: 1.0 } );
// GROUND
......
......@@ -307,7 +307,7 @@
"shiny" :
{
m: new THREE.MeshPhongMaterial( { color: 0x550000, specular: 0x440000, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.3, metal: true } ),
m: new THREE.MeshStandardMaterial( { color: 0x550000, envMap: reflectionCube, roughness: 0.1, metalness: 1.0 } ),
h: 0, s: 0.8, l: 0.2
},
......
......@@ -249,7 +249,7 @@
group.add( mesh );
var meshmaterials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x405040, wireframe: true, opacity: 0.8, transparent: true } )
];
......
......@@ -283,7 +283,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true } )
];
......
......@@ -210,7 +210,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } )
];
......
......@@ -226,7 +226,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } )
];
......
......@@ -140,7 +140,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } )
];
......
......@@ -207,7 +207,7 @@
var materials = [
new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors } ),
new THREE.MeshPhongMaterial( { color: 0xffffff, shading: THREE.FlatShading, vertexColors: THREE.VertexColors, shininess: 0 } ),
new THREE.MeshBasicMaterial( { color: 0x000000, shading: THREE.FlatShading, wireframe: true, transparent: true } )
];
......
......@@ -163,7 +163,7 @@
// YELLOW PYRAMID and PYRAMID'S SHADOW
var pyramidGeometry = new THREE.CylinderGeometry( 0, 0.5, 2, 4 );
var pyramidMaterial = new THREE.MeshLambertMaterial( { color: 'rgb(255,255,0)', emissive: 0x440000, shading: THREE.FlatShading } );
var pyramidMaterial = new THREE.MeshPhongMaterial( { color: 'rgb(255,255,0)', emissive: 0x440000, shading: THREE.FlatShading, shininess: 0 } );
pyramid = new THREE.Mesh( pyramidGeometry, pyramidMaterial );
pyramid.position.set( - 4, 1, 2 );
scene.add( pyramid );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册