kottore / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

Set outline for static objects bug #121

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
package  
{
    import away3d.containers.View3D;
    import away3d.materials.WireframeMaterial;
    import away3d.primitives.Sphere;
    import flash.display.Sprite;

    public class Bug extends Sprite
    {

        public function Bug() 
        {
            var view:View3D = new View3D({ x:stage.stageWidth / 2, y:stage.stageHeight / 2});
            var s:Sphere = new Sphere();
            view.scene.addChild(s);
            addChild(view);
            view.render();

            s.outline = new WireframeMaterial(0xFF0000 ,{thickness: 10});

            view.render();
        }

    }

}

What is the expected output?
A wireframe sphere rendered with a 10px thick red outline.

What do you see instead?
A wireframe sphere rendered without outline.

What version of the product are you using? On what operating system?
Away3D 3.5, FP 10

Please provide any additional information below.
Note that there are 2 render calls, the first one makes sure that all the init 
is complete.
I dug a little bit into the code, and it seems that setting _sessionDirty to 
true will fix the issue. So I created the following method in the Mesh Class:

public function setOutline(o:Material):void
{
    outline = o;
    _sessionDirty = true;
}

It seems to work.

This happens only to static objects, if you transform the object after applying 
the outline, it will render.

Original issue reported on code.google.com by nikita.leshenko@gmail.com on 19 Jun 2010 at 4:57