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

Change segments at run time, uv mapping error bug? #21

Open
Neugls opened this issue Aug 13, 2012 · 4 comments
Open

Change segments at run time, uv mapping error bug? #21

Neugls opened this issue Aug 13, 2012 · 4 comments

Comments

@Neugls
Copy link

Neugls commented Aug 13, 2012

If you changes the segments of Plane or Cube which I have noticed, the result may have UV mapping error.
I have the following code

                    plane = new Plane();
        plane.width = 500;
        plane.height = 500;
        plane.bothsides = true;
        plane.segmentsH = 1;
        plane.segmentsW = 1;
        plane.material = new BitmapFileMaterial("");
        scene.addChild(plane);

        StartToRender();
        stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
    }

    protected function onKeyDown(E:KeyboardEvent):void{
        if(E.keyCode == Keyboard.F3){
            plane.width += 3;
            plane.segmentsW ++
        }
        if(E.keyCode == Keyboard.F4){
            plane.height += 3;
            plane.segmentsH ++
        }
    }
@richardolsson
Copy link
Member

Although we have not made any official decisions regarding supporting old versions of the engine, I'm afraid that it's unlikely that this bug will be fixed for Away3D 3.6, now that stable Flash Player 11 has been out for almost a year, and Away3D 4.0 was first published a year ago. All our effort is going towards further developing the total rewrite of the engine that is Away3D 4.x.

@Neugls
Copy link
Author

Neugls commented Aug 13, 2012

Thank you for reply, can you give me any tip for me what can i do to fix this for I have an old project used away3d 3.6, I think I should make it fixed before using the Away3d 4.x


Neugls Work Studio
Neugls
[email protected]

@Neugls
Copy link
Author

Neugls commented Aug 14, 2012

I think I have found out where caused this problem after a days time reading the source code of Away3d 3.6.
This bug may appear when you use the BitmapMaterial, For the render rendering a triangle face, it calls the renderTriangle
method of the BitmapMaterial. In BitmapMaterial, it used a dictionary called _faceDictionary to store the uvt data of the face , when the uv data changed in the faces, the _faceDictionary did not changes, so it caused the problem. To sets the invalidated property of the _faceMaterialVO in dictionary _faceDictionary may fix this bug. I extends the BitmapMaterial and add a new method to update this, it works.

@richardolsson
Copy link
Member

Feel free to file a pull request if you fix the issue in the Away3D code.

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

2 participants