mrdoob/three.js — Issue #1441: Linewidth
Author: ashgavs
Created: 2012-03-04 20:25:22+00:00
State: open

This is a question as opposed to a bug or feature. I am making a feature that allows users to draw onto a cylinder using the line class. Every time the mouse moves a line is draw connecting the previous mouse location and the current one. It works very well, here a snippet code:

var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( new THREE.Vector3( position.x, position.y, position.z ) ) );
geometry.vertices.push( new THREE.Vertex( new THREE.Vector3( newPosition.x, newPosition.y, newPosition.z ) ) );
var lineMaterial = new THREE.LineBasicMaterial( { color: 0xff0000, opacity: 1, linewidth: 3 } );
var line = new THREE.Line( geometry, lineMaterial );
scene.add(line);
position = newPosition;

There is some other stuff here but this is the only code relevant to my question. newPosition = the current mouse location and position = the old one. This is called in a mousemove listener. My question is about the linewidth. No matter what value I put in there the line width always appears as about a pixel wide, even when I give it something massive. Is there something that I am missing to make sure that its as wide as it needs to be? Ideally the user will control the color and width of the line... Thanks so much!
--Ashley