how to convert a 2d path to a 3d shape in Three.js?

Posted by VirtualWorld on Stack Overflow See other posts from Stack Overflow or by VirtualWorld
Published on 2012-06-24T05:00:40Z Indexed on 2012/06/24 9:16 UTC
Read the original article Hit count: 347

Filed under:
|

i need to have the 3d of this: http://jsfiddle.net/dAdKm/
but when i use this code:

var shape = new THREE.Shape();
shape.moveTo(20,20);
shape.bezierCurveTo(20, 100, 150, 100, 150, 20);
shape.moveTo(20,20);
shape.lineTo(20, 100);
shape.lineTo(150, 100);
shape.lineTo(150, 20);

var shape3d = shape.extrude(extrudeSettings);
var shapePoints = shape.createPointsGeometry();
var shapeSpacedPoints = shape.createSpacedPointsGeometry();
var material = new THREE.MeshBasicMaterial({ color: 0x0000ff });
var shapeMesh = new THREE.Mesh(shape3d, material);

the result is not same as 2d context result, why? what is the problem?

© Stack Overflow or respective owner

Related posts about webgl

Related posts about three.js