Skip to content

Commit

Permalink
Merge pull request #14931 from Mugen87/dev19
Browse files Browse the repository at this point in the history
Examples: Remove linewidth where it has no effect
  • Loading branch information
mrdoob committed Sep 19, 2018
2 parents 0e67eaa + 064722b commit d3be2dd
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 31 deletions.
1 change: 0 additions & 1 deletion examples/webgl_animation_skinning_morph.html
Expand Up @@ -218,7 +218,6 @@
scene.add( mesh2 );

helper = new THREE.SkeletonHelper( mesh );
helper.material.linewidth = 3;
helper.visible = false;
scene.add( helper );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_decals.html
Expand Up @@ -128,7 +128,7 @@
var geometry = new THREE.BufferGeometry();
geometry.setFromPoints( [ new THREE.Vector3(), new THREE.Vector3() ] );

line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { linewidth: 4 } ) );
line = new THREE.Line( geometry, new THREE.LineBasicMaterial() );
scene.add( line );

loadLeePerrySmith();
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl_geometry_nurbs.html
Expand Up @@ -112,7 +112,7 @@
var nurbsGeometry = new THREE.BufferGeometry();
nurbsGeometry.setFromPoints( nurbsCurve.getPoints( 200 ) );

var nurbsMaterial = new THREE.LineBasicMaterial( { linewidth: 10, color: 0x333333 } );
var nurbsMaterial = new THREE.LineBasicMaterial( { color: 0x333333 } );

var nurbsLine = new THREE.Line( nurbsGeometry, nurbsMaterial );
nurbsLine.position.set( 200, - 100, 0 );
Expand All @@ -121,7 +121,7 @@
var nurbsControlPointsGeometry = new THREE.BufferGeometry();
nurbsControlPointsGeometry.setFromPoints( nurbsCurve.controlPoints );

var nurbsControlPointsMaterial = new THREE.LineBasicMaterial( { linewidth: 2, color: 0x333333, opacity: 0.25, transparent: true } );
var nurbsControlPointsMaterial = new THREE.LineBasicMaterial( { color: 0x333333, opacity: 0.25, transparent: true } );

var nurbsControlPointsLine = new THREE.Line( nurbsControlPointsGeometry, nurbsControlPointsMaterial );
nurbsControlPointsLine.position.copy( nurbsLine.position );
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl_geometry_shapes.html
Expand Up @@ -123,15 +123,15 @@

// solid line

var line = new THREE.Line( geometryPoints, new THREE.LineBasicMaterial( { color: color, linewidth: 3 } ) );
var line = new THREE.Line( geometryPoints, new THREE.LineBasicMaterial( { color: color } ) );
line.position.set( x, y, z - 25 );
line.rotation.set( rx, ry, rz );
line.scale.set( s, s, s );
group.add( line );

// line from equidistance sampled points

var line = new THREE.Line( geometrySpacedPoints, new THREE.LineBasicMaterial( { color: color, linewidth: 3 } ) );
var line = new THREE.Line( geometrySpacedPoints, new THREE.LineBasicMaterial( { color: color } ) );
line.position.set( x, y, z + 25 );
line.rotation.set( rx, ry, rz );
line.scale.set( s, s, s );
Expand Down
9 changes: 3 additions & 6 deletions examples/webgl_geometry_spline_editor.html
Expand Up @@ -258,8 +258,7 @@
curve.curveType = 'catmullrom';
curve.mesh = new THREE.Line( geometry.clone(), new THREE.LineBasicMaterial( {
color: 0xff0000,
opacity: 0.35,
linewidth: 2
opacity: 0.35
} ) );
curve.mesh.castShadow = true;
splines.uniform = curve;
Expand All @@ -268,8 +267,7 @@
curve.curveType = 'centripetal';
curve.mesh = new THREE.Line( geometry.clone(), new THREE.LineBasicMaterial( {
color: 0x00ff00,
opacity: 0.35,
linewidth: 2
opacity: 0.35
} ) );
curve.mesh.castShadow = true;
splines.centripetal = curve;
Expand All @@ -278,8 +276,7 @@
curve.curveType = 'chordal';
curve.mesh = new THREE.Line( geometry.clone(), new THREE.LineBasicMaterial( {
color: 0x0000ff,
opacity: 0.35,
linewidth: 2
opacity: 0.35
} ) );
curve.mesh.castShadow = true;
splines.chordal = curve;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_interactive_buffergeometry.html
Expand Up @@ -206,7 +206,7 @@
var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( 4 * 3 ), 3 ) );

var material = new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 2, transparent: true } );
var material = new THREE.LineBasicMaterial( { color: 0xffffff, transparent: true } );

line = new THREE.Line( geometry, material );
scene.add( line );
Expand Down
13 changes: 0 additions & 13 deletions examples/webgl_interactive_lines.html
Expand Up @@ -189,26 +189,13 @@

if ( intersects.length > 0 ) {

if ( currentIntersected !== undefined ) {

currentIntersected.material.linewidth = 1;

}

currentIntersected = intersects[ 0 ].object;
currentIntersected.material.linewidth = 5;

sphereInter.visible = true;
sphereInter.position.copy( intersects[ 0 ].point );

} else {

if ( currentIntersected !== undefined ) {

currentIntersected.material.linewidth = 1;

}

currentIntersected = undefined;

sphereInter.visible = false;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_lines_dashed.html
Expand Up @@ -76,7 +76,7 @@

var geometryCube = cube( 50 );

var lineSegments = new THREE.LineSegments( geometryCube, new THREE.LineDashedMaterial( { color: 0xffaa00, dashSize: 3, gapSize: 1, linewidth: 2 } ) );
var lineSegments = new THREE.LineSegments( geometryCube, new THREE.LineDashedMaterial( { color: 0xffaa00, dashSize: 3, gapSize: 1 } ) );
lineSegments.computeLineDistances();

objects.push( lineSegments );
Expand Down
6 changes: 3 additions & 3 deletions examples/webgl_lines_sphere.html
Expand Up @@ -75,16 +75,16 @@
scene = new THREE.Scene();

var i, line, material, p,
parameters = [ [ 0.25, 0xff7700, 1, 2 ], [ 0.5, 0xff9900, 1, 1 ], [ 0.75, 0xffaa00, 0.75, 1 ], [ 1, 0xffaa00, 0.5, 1 ], [ 1.25, 0x000833, 0.8, 1 ],
[ 3.0, 0xaaaaaa, 0.75, 2 ], [ 3.5, 0xffffff, 0.5, 1 ], [ 4.5, 0xffffff, 0.25, 1 ], [ 5.5, 0xffffff, 0.125, 1 ] ];
parameters = [ [ 0.25, 0xff7700, 1 ], [ 0.5, 0xff9900, 1 ], [ 0.75, 0xffaa00, 0.75 ], [ 1, 0xffaa00, 0.5 ], [ 1.25, 0x000833, 0.8 ],
[ 3.0, 0xaaaaaa, 0.75 ], [ 3.5, 0xffffff, 0.5 ], [ 4.5, 0xffffff, 0.25 ], [ 5.5, 0xffffff, 0.125 ] ];

var geometry = createGeometry();

for( i = 0; i < parameters.length; ++ i ) {

p = parameters[ i ];

material = new THREE.LineBasicMaterial( { color: p[ 1 ], opacity: p[ 2 ], linewidth: p[ 3 ] } );
material = new THREE.LineBasicMaterial( { color: p[ 1 ], opacity: p[ 2 ] } );

line = new THREE.LineSegments( geometry, material );
line.scale.x = line.scale.y = line.scale.z = p[ 0 ];
Expand Down
2 changes: 1 addition & 1 deletion examples/webvr_ballshooter.html
Expand Up @@ -136,7 +136,7 @@
geometry.addAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 0, - 1 ], 3 ) );
geometry.addAttribute( 'color', new THREE.Float32BufferAttribute( [ 0.5, 0.5, 0.5, 0, 0, 0 ], 3 ) );

var material = new THREE.LineBasicMaterial( { vertexColors: true, linewidth: 2, blending: THREE.AdditiveBlending } );
var material = new THREE.LineBasicMaterial( { vertexColors: true, blending: THREE.AdditiveBlending } );

controller1.add( new THREE.Line( geometry, material ) );
controller2.add( new THREE.Line( geometry, material ) );
Expand Down

0 comments on commit d3be2dd

Please sign in to comment.