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

TextExtrusion.as #6

Open
DarceyLloyd opened this issue Jul 27, 2011 · 0 comments
Open

TextExtrusion.as #6

DarceyLloyd opened this issue Jul 27, 2011 · 0 comments

Comments

@DarceyLloyd
Copy link

  • Depth extrusion with light appear to be on wrong side of certain letters in different fonts (could be a font issue or wu getting data correct?)
  • Extrustion material doesn't change
  • Extrusion param back material doesn't do anything
  • Depth is not an essential param (not really a bug)

Here is code correction for allowing material to be supplied and depth to be a required param, replace constructor:

    public function TextExtrusion(mesh:Mesh,material:Material,depth:Number, init:Object=null)
    {
        super(init);

        _mesh = mesh;
        _face = face;
        _subdivisionsZ = ini.getNumber("subdivisionsZ", 1, {min:1, max:100});
        _subdivisionsXY = ini.getNumber("subdivisionsXY", 1, {min:1, max:100});
        //_depth = ini.getNumber("depth", 100); // Original code
        _depth = depth;


        //_material = mesh.material as Material; // Original code (locks material to mesh material
        _material = material;

        for each(var face:Face in mesh.faces)
        generateFaceExtrusion(face);
    }

Usage:
// Give 3D text some depth via TextExtrusion class
var extrusionMaterial:WireColorMaterial = new WireColorMaterial(0x666666);
var textExtrusion:TextExtrusion = new TextExtrusion(txt,extrusionMaterial,150);
textExtrusion.bothsides = true;
//textExtrusion.material = new WireColorMaterial(0x666666); // Dont work in 3.6 Dated: 27-07-2011
//textExtrusion.back = new WireColorMaterial(0x666666); // Dont work in 3.6 Dated: 27-07-2011
textExtrusion.z = txt.z;
scene.addChild(textExtrusion);

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

1 participant