Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extrude material no longer an option in three.js r72 #7332

Closed
elifer5000 opened this issue Oct 12, 2015 · 9 comments
Closed

Extrude material no longer an option in three.js r72 #7332

elifer5000 opened this issue Oct 12, 2015 · 9 comments

Comments

@elifer5000
Copy link

Up until r71, TextGeometry (itself based on ExtrudeGeometry) had the option to select different materials for the front and the extruded faces. The code below would be able to produce:
screen shot 2015-10-11 at 16 02 28

var materialFront = new THREE.MeshBasicMaterial( { color: 0xE94042  } );
var materialSide = new THREE.MeshBasicMaterial( { color: 0x000000 } );
var materialArray = [ materialFront, materialSide ];
var textMaterial = new THREE.MeshFaceMaterial(materialArray);

var textProperties = {
        size: 5, height: 1.0, curveSegments: 3,
        font: "helvetiker", weight: "normal", style: "normal",
        bevelEnabled: true, bevelThickness: 0, bevelSize: 0,
        material: 0, extrudeMaterial: 1
    };

var textGeom = new THREE.TextGeometry( "100.0", textProperties);
var textMesh = new THREE.Mesh(textGeom, textMaterial );

I found this commit in the project's github where the option to set the material and extrudeMaterial was removed, with no apparent alternative way to achieve the same result. Now in r72 all the faces have the same color (the one from materialFront), like this:
screen shot 2015-10-11 at 16 06 16

Samples:
JSFiddle with r72 - side color is missing
JSFiddle with r71 - works ok

@WestLangley
Copy link
Collaborator

It appears the changes toExtrudeGeometry implemented here need to be reverted -- if possible.

@mrdoob
Copy link
Owner

mrdoob commented Oct 13, 2015

Reverted/Fixed. http://jsfiddle.net/ma3wtuLx/7/

@mrdoob mrdoob closed this as completed Oct 13, 2015
@WestLangley
Copy link
Collaborator

@mrdoob many thanks!

@mrdoob
Copy link
Owner

mrdoob commented Oct 14, 2015

😊

@elifer5000
Copy link
Author

Thanks for the quick response! And fix!

@SenninSensei
Copy link

i don't understand how to use a a diferent material for the extrudeMaterial this doesn't work anymore http://jsfiddle.net/ma3wtuLx/7/

@WestLangley
Copy link
Collaborator

@SenninSensei It seems to work: http://jsfiddle.net/ma3wtuLx/9/. r.74dev

@MasterJames
Copy link
Contributor

It seems these are not working though.

material: 0, extrudeMaterial: 0

@WestLangley
Copy link
Collaborator

It seems these are not working though.

material: 0, extrudeMaterial: 0

Yes. It appears to be hardwired, now. The first material is for the front, and the second material is for the side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants