Hi Jochem,
Its difficult to say without actually be able to inspect the source model itself but here a few hints that might help.
Make sure your texture is properly mapped.
in Prefab, you could select your floor, open the uv editor, and select project from top, and apply then export. Note also that if you have too poor geometry some artefacts might occur. Also make sure you do not have duplicated faces in your model and that at export all faces were triangulated.
you could try set an another renderer to the view.
_view = new View3D({renderer:Renderer.CORRECT_Z_ORDER});

your second point can be fixed by using the native MouseEvent3D
like this

mymesh.addOnMouseDown(changeTexture);

function changeTexture(e:MouseEvent3D)
((e.object as Mesh).material as BitmapMaterial).bitmap = mynewbitmapdata;

or if your mesh is unique, a regular event is enough.
function changeTexture(e:Event)
        this.mymesh.material = new MaterialOfMychoice();

Look on doc for MouseEvent3D for event properties
http://away3d.com/livedocs/

Fabrice

On Nov 26, 2009, at 11:04 AM, Jochem Neerhof wrote:

Hello Away3D.
First of all I would like to congratulate you on Away3D. It's great!
I'm experimenting with it for an internship. I didn't have much
experience with AS3 programming before the start of my internship,
hence the term experimenting;)
But after many hours of experimenting I actually got things working.
Up until now the problems I faced I could solve myself, but now I'm
really stuck. Sorry to bother you guys with questions which may be
beginner questions.

I've got 2 problems that I can't find a solution for:
1. I've imported an OBJ file in Prefab and exported it as an AS file.
I can get the models to display, but the textures deform on the model
when I run my project. I've uploaded a file called afbeelding_1.png
which shows the problem. The texture on the floor somehow shifted on
some places and also the bars on the chair are transparent. If you
change the point of view the textures move on the surface of the
model. Any idea how to fix this?

2. My second problem is in my code. I added a MouseEvent that changes
the texture on the model you click on. This works on the chair. So I
used the exact same code and changed all the names to add the same
feature to the floor. But now the texture on the floor won't
change:S.
In my Main.as I create the MouseEvent. With every click on a model I
change the value of a Global variable. That variable triggers a switch
in the model AS file which changes the bitmap for the texture.
I know the variable changes correctly and triggers each case
correctly. It just doesn't show the different textures:S.

I searched the web for many hours but I can't find an answer for both
of my problems. Any help is very much appreciated:).

Jochem


Reply via email to