Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mrdoob/three.js
base: 5e49f0dded
...
head fork: mrdoob/three.js
compare: 56d94a5b79
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 3 commit comments
  • 1 contributor
View
16 examples/webgl_lines_colors.html
@@ -119,14 +119,14 @@
// lines
- material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 1, linewidth: 3 } );
-
- var line, p, scale = 0.3, d = 225,
- parameters = [ [ material, scale*1.5, [-d,0,0], geometry ],
- [ material, scale*1.5, [0,0,0], geometry2 ],
- [ material, scale*1.5, [d,0,0], geometry3 ] ];
-
- material.vertexColors = true;
+ material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors } );
+
+ var line, p, scale = 0.3, d = 225;
+ var parameters = [
+ [ material, scale*1.5, [-d,0,0], geometry ],
+ [ material, scale*1.5, [0,0,0], geometry2 ],
+ [ material, scale*1.5, [d,0,0], geometry3 ]
+ ];
for ( i = 0; i < parameters.length; ++i ) {
View
16 examples/webgl_lines_splines.html
@@ -121,14 +121,14 @@
// lines
- material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 1, linewidth: 3 } );
-
- var line, p, scale = 0.3, d = 225,
- parameters = [ [ material, scale*1.5, [-d,0,0], geometry ],
- [ material, scale*1.5, [0,0,0], geometry2 ],
- [ material, scale*1.5, [d,0,0], geometry3 ] ];
-
- material.vertexColors = true;
+ material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors } );
+
+ var line, p, scale = 0.3, d = 225;
+ var parameters = [
+ [ material, scale*1.5, [-d,0,0], geometry ],
+ [ material, scale*1.5, [0,0,0], geometry2 ],
+ [ material, scale*1.5, [d,0,0], geometry3 ]
+ ];
for ( i = 0; i < parameters.length; ++ i ) {
View
28 gui/js/ui/Viewport.js
@@ -7,11 +7,29 @@ var Viewport = function ( signals ) {
var sceneHelpers = new THREE.Scene();
- var plane = new THREE.Mesh(
- new THREE.PlaneGeometry( 1000, 1000, 20, 20 ),
- new THREE.MeshBasicMaterial( { color: 0x606060, wireframe: true, transparent: true } )
- );
- sceneHelpers.add( plane );
+ var size = 500, step = 25;
+ var geometry = new THREE.Geometry();
+ var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } );
+ var color1 = new THREE.Color( 0x444444 ), color2 = new THREE.Color( 0x888888 );
+
+ for ( var i = - size; i <= size; i += step ) {
+
+ geometry.vertices.push( new THREE.Vector3( -size, 0, i ) );
+ geometry.vertices.push( new THREE.Vector3( size, 0, i ) );
+
+ geometry.vertices.push( new THREE.Vector3( i, 0, -size ) );
+ geometry.vertices.push( new THREE.Vector3( i, 0, size ) );
+
+ var color = i === 0 ? color1 : color2;
+
+ geometry.colors.push( color, color, color, color );
+
+ }
+
+ var grid = new THREE.Line( geometry, material, THREE.LinePieces );
+ sceneHelpers.add( grid );
+
+ //
var scene = new THREE.Scene();

Showing you all comments on commits in this comparison.

@alteredq

This new grid looks terrible in ANGLE :/

http://alteredqualia.com/tmp/img/gui-grid.png

In OpenGL it's ok.

Edit: looking more into this, it's not just the grid, whole antialiasing is completely messed up (e.g. I can see faint outline of sphere in different color).

I think some of this magic you use for DOM positioning confuses DirectX renderer / layout compositor.

@alteredq

Ok, found a workaround, it goes away if you don't use transparency and background color from the DOM:

alteredq@daac5c4

@mrdoob
Owner

ANGLE, ANGLE... Good that you found a workaround! ... and that you noticed the magic for DOM positioning ;)

Something went wrong with that request. Please try again.