BitmapMaterial on Mesh vs. on primitive Plane - how to avoid repeating texture on faces of mesh?

Software: Away3D 3.x

Benjamin, Newbie
Posted: 17 September 2012 06:13 PM   Total Posts: 7

Hi!
I’m quite new to Away3D and 3D in general and really need some help.

I’ve got the following problem: I built a primitive Plane in Blender, exported it as OBJ and imported it in Prefab. Then I exported it as AS3-class. 

Now I want to change the texture of the Plane during runtime - I instantiate the exported
AS3-class (named “E1”), get the Mesh and apply a material to it:

var e1:E1 = new E1();
var 
m1:Mesh Mesh(e1.getChildByName("Plane1"));
var 
mat:Material Cast.material(m2_bitmap);
m1.material mat

The problem: the texture is spread/split over the two faces of the Mesh (see attached image). How can I avoid this? At the right you see a Plane I added using “new Plane()” and then applied the same material. This is what it should look like…

Any help will be appreciated - been struggling with this the whole day :(
Thanx a lot!
Ben

 

   

Avatar
80prozent, Sr. Member
Posted: 17 September 2012 07:16 PM   Total Posts: 430   [ # 1 ]

Hi

it the uv-mapping /uvBuffer thats wrong.

if you only need a plane with this bitmap on it, try using a PlaneGeometry Object instead of a imported mesh. it will allready have the correct uvmapping set up.

if you want to use more complex meshes, you have to make shure to create the uv-mapping in your 3d-application.

a good way to check your exportet models before using in your project is using prefab.

hope that helps

 Signature 

sorry…i hope my actionscript is better than my english…

   

Benjamin, Newbie
Posted: 17 September 2012 09:23 PM   Total Posts: 7   [ # 2 ]

Hi,

thx for your answer! I’m using Away3D 3.6, so I think there’s no PlaneGeometry-class.
In this project I will have to deal only, but with a lot of simple planes with dynamically attached materials.

I don’t really get the thing with the uv-mapping - do you think it would help to apply a texture in blender, export it and then exchange the texture during runtime? I realized that there’s also a uv-editor in Prefab - can I achieve “exporting” the orientation for the later texturing in Flash?

Again: materials have to be attached at runtime in Flash.

Thanx for further help!
Ben

   

Avatar
Fabrice Closier, Administrator
Posted: 17 September 2012 10:02 PM   Total Posts: 1265   [ # 3 ]

There is a Projector class for this. Prefab also allows you to project the image on any mesh.
But a plane is so easy to make, you should simply declare a new Plane and pass a bitmapMaterial to it. No need for Blender or Prefab here.

   

Benjamin, Newbie
Posted: 18 September 2012 06:04 AM   Total Posts: 7   [ # 4 ]

Thx again - my model consists of a lot of planes (say 100, positioned to each other in a quite complex way) - so I cannot bypass a modelling tool and just generate the planes programmatically directly in Flash/Away3D.

The thing I’m trying to achieve is to draw textures on each of the planes dynamically at runtime (textures will even change during runtime).moreover, the textures will have to be interactive (MovieMaterial) and will have to be drawn very exact. 

Interaction with MovieMaterial, dynamical changing Materials - all solved! I only need to put the texture over the WHOLE plane correctly - not split over it’s faces. Basically I just want to draw an Image on a Mesh which looks like a plane - can’t be too hard ... (sry, start getting frustrated wink)
Guess I really miss something about the UV-mapping thing.

Played around with the Projector-class as well, but did not work out any useful result.

Thx so much for further hints/explanations/help!
Ben

   

Benjamin, Newbie
Posted: 19 September 2012 10:33 AM   Total Posts: 7   [ # 5 ]

Ok - understood. it’s all about UV-Mapping, which has to be done in the 3D-modeling application. Without UV-definition, the engine simply can not know how the material should be applied to the mesh.
Fortunately, I have a good 3D-artist which is able to solve the problem wink

Anyway - thx for hints and help!
Ben

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X