Hi,
it seems that the problem with the extruded text and bitmap Material
isn´t necessarily related with the extrusion as i thought before.
i realized that it also doesnt´work with normal 3D Text:

http://groups.google.com/group/away3d-dev/web/fontMaterial.jpg

Can it be that the material will only be assigned to the first
triangle of each Letter?

additionally i get an error on mouseOver on the letters
(sorry, it´s german, but i guess you know the error type)

TypeError: Error #1009: Der Zugriff auf eine Eigenschaft oder eine
Methode eines null-Objektverweises ist nicht möglich.
        at away3d.containers::View3D/checkPrimitive()
        at away3d.containers::View3D/checkSession()
        at away3d.containers::View3D/checkSession()
        at away3d.containers::View3D/findHit()
        at away3d.containers::View3D/fireMouseEvent()
        at away3d.containers::View3D/fireMouseMoveEvent()
        at away3d.containers::View3D/render()
        at TextBitmapMaterialSimple/onEnterFrame()



The only line changed in the code ist this one:

material1 = new WireColorMaterial();
to:
material1 = new BitmapFileMaterial("earthmap1k.jpg");

This is the code i used:

package
{
        import flash.display.Sprite;
        import flash.events.Event;
        import away3d.cameras.*;
import away3d.containers.*;
import away3d.core.base.Mesh;
import away3d.core.math.Number3D;
import away3d.core.render.SpriteRenderSession;
import away3d.extrusions.TextExtrude;
import away3d.lights.PointLight3D;
import away3d.materials.*;
import away3d.primitives.*;
import away3d.events.*; //

import wumedia.vector.*;
        /**
         * ...
         * @author me
         */
        public class TextBitmapMaterialSimple extends Sprite
        {

                //engine variables
                var scene:Scene3D;
                var camera:Camera3D;
                var view:View3D;

                //material objects
                var material1;

                //scene objects
                var textfield1:TextField3D;
                var pointLight:PointLight3D;



                public function TextBitmapMaterialSimple():void
                {
                        if (stage) init();
                        else addEventListener(Event.ADDED_TO_STAGE, init);
                }

                private function init(e:Event = null):void
                {
                        removeEventListener(Event.ADDED_TO_STAGE, init);

                                initEngine();
                                initMaterials();
                                initText();
                                initLights();
                                initObjects();
                                initListeners();


                }

                /**
                 * Initialise the engine
                 */
                function initEngine():void
                {
                        scene = new Scene3D();

                        //camera = new Camera3D({z:-1000});
                        camera = new Camera3D();
                        camera.z = -1000;

                        //view = new View3D({scene:scene, camera:camera});
                        view = new View3D();
                        view.scene = scene;
                        view.camera = camera;

                        addChild(view);


                }

                /**
                 * Initialise the text
                 */
                function initText():void // was macht das?
                {
                        VectorText.extractFont(loaderInfo.bytes, null, false);
                }

                /**
                 * Initialise the materials
                 */
                function initMaterials():void
                {

                        material1 = new BitmapFileMaterial("earthmap1k.jpg");

                }


                /**
                 * Initialise the lights
                 */
                function initLights():void
                {
                        pointLight = new PointLight3D();
                        pointLight.color = 0xFFFFFF;
                        pointLight.ambient = 0.25;
                        pointLight.diffuse = 2;
                        pointLight.specular = 10;
                        scene.addChild(pointLight);
                }

                function initObjects():void
                {

                        textfield1 = new TextField3D("Impact");
                        textfield1.material = material1;
                        textfield1.text = "Test";
                        textfield1.size = 150;
                        textfield1.textWidth = 2000;
                        scene.addChild(textfield1);

                }


                /**
 * Initialise the listeners
 */
function initListeners():void
{
        addEventListener(Event.ENTER_FRAME, onEnterFrame);

}


/**
 * Navigation and render loop
 */
function onEnterFrame(event:Event):void
{
        view.render();

}

        }

}

Reply via email to