Repeat Textures

2 views
Skip to first unread message

StarbuckZero

unread,
Aug 17, 2009, 9:43:42 AM8/17/09
to away3d.dev
I'm having problems with repeatable textures using the 3ds format. Is
there any other format I could use? Has anyone else ran into this
problem?

desgraci

unread,
Aug 17, 2009, 9:47:07 AM8/17/09
to away3d.dev
i have never run into that problem, but u can for sure use a lot of
formats in away, try the .dae. but the problem shouldnt be into the
model if u see the model working properly in ur editor.
P.D. im suposing that ure talking about the repeat propertie of ur
material.

StarbuckZero

unread,
Aug 17, 2009, 12:02:20 PM8/17/09
to away3d.dev
We're using a .obj from Maya 2008 and .3ds from Max and we're
exporting from .flt files. You think we're losing data in the export?
It comes up just fine in other programs.

desgraci

unread,
Aug 17, 2009, 12:29:58 PM8/17/09
to away3d.dev
well, ure exporting from .flt (1), and then u use the model u get from
Maya and Max (2), if the model is right in visualizad without problems
in maya and 3ds (ofc in .ob and .3ds) then ure not loosing anything
that should care to the away3d engine in the process, i have done some
exporting of that kind before, and the onle one that caused me trouble
was trying to export from sketchup to anything, but i could check the
mistakes in blender (yes i use blender :p) before even using away3d.
now, if u have a picture of the problem... (doesnt have to be the one
ure working with, only one that shows that) that will help a lot to
see what can may be causing this.

desgraci

unread,
Aug 17, 2009, 12:31:42 PM8/17/09
to away3d.dev
btw sorry for the english if something was unclear let me know.

StarbuckZero

unread,
Aug 17, 2009, 2:33:26 PM8/17/09
to away3d.dev
How do I add images to this post?

Peter Kapelyan

unread,
Aug 17, 2009, 2:36:04 PM8/17/09
to away3...@googlegroups.com
You can add images in the "File" Section of the group front page or the link is here:

http://groups.google.com/group/away3d-dev/files?upload=1

-Pete
--
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

ScottB

unread,
Aug 17, 2009, 2:36:22 PM8/17/09
to away3d.dev
We discovered there's a line of script required for repeating textures
to work.

(modelMaterialData.material as BitmapMaterial).repeat = true;

Just use that for each material that repeats when you set up your
materials and they should show up correctly.

desgraci

unread,
Aug 17, 2009, 2:45:32 PM8/17/09
to away3d.dev
"
desgraci

i have never run into that problem...

...P.D. im suposing that ure talking about the repeat propertie of ur
material.

"
hehehe, well thats the repeat property :p


StarbuckZero

unread,
Aug 17, 2009, 3:10:53 PM8/17/09
to away3d.dev
Once I load in the file how do I go about getting a list of the
material data so I can type cast it?

StarbuckZero

unread,
Aug 17, 2009, 3:11:50 PM8/17/09
to away3d.dev
Okay, I'm uploading the files now.

On Aug 17, 2:36 pm, Peter Kapelyan <flashn...@gmail.com> wrote:
> You can add images in the "File" Section of the group front page or the link
> is here:
>
> http://groups.google.com/group/away3d-dev/files?upload=1
>
> -Pete
>

StarbuckZero

unread,
Aug 17, 2009, 3:18:02 PM8/17/09
to away3d.dev
Ok the files are up under Stretching1.jpg and Stretching2.jpg

desgraci

unread,
Aug 17, 2009, 3:19:52 PM8/17/09
to away3d.dev
try modifying material.precision=2 to see, let me know.

desgraci

unread,
Aug 18, 2009, 8:03:13 AM8/18/09
to away3d.dev
so did it work?

StarbuckZero

unread,
Aug 18, 2009, 8:17:15 AM8/18/09
to away3d.dev
I'm trying to get it to load with the new 3.4 version but addOnSuccess
is not being used any more so I downloaded the examples to figure out
why. What's the new way to load stuff?

On Aug 18, 8:03 am, desgraci <ierafaelper...@yahoo.com> wrote:
> so did it work?

desgraci

unread,
Aug 18, 2009, 8:38:36 AM8/18/09
to away3d.dev
i think that they use a loader3d, is kinda generic now, not sure just
readed some docs. (away3d.loaders)

StarbuckZero

unread,
Aug 18, 2009, 1:04:49 PM8/18/09
to away3d.dev
My co-worker has to re-export the file but I'll keep you posted soon.

StarbuckZero

unread,
Aug 18, 2009, 1:17:51 PM8/18/09
to away3d.dev
When you say material.precision = 2 what do you want me to change it
on?

desgraci

unread,
Aug 18, 2009, 8:46:04 PM8/18/09
to away3d.dev
well, lets say ure using a model

mymodel=theparser(mymodel,{material:myMaterial{);

well myMaterial could be

myMaterial=new BitmapMaterial(Cast.bitmap
(the_class_where_u_have_or_embebbed_the_picture_ure_using_for_material));

well myMaterial have in their attributes the precision propertie, that
is used to fix this UV problems.

u can make

myMaterial.precision=1;

and then u call the model with that texture.

try it to see if it fix it.

StarbuckZero

unread,
Aug 19, 2009, 3:40:35 AM8/19/09
to away3d.dev
I'm loading the file from a directory. Here is some of the code:


loader = Max3DS.load(value, { x:(stage.stageWidth / 2), y:
(stage.stageHeight / 2),z:-1000,material:null} );


loader.addOnSuccess(onLoaderSuccess);
loader.addOnError(onLoaderError);

loader.ownCanvas = true;
loader.scale(100);

Then once it's loaded

private function onLoaderSuccess( event:Loader3DEvent ):void

{

trace("onLoaderSuccess");

// Set cam to hover around object
if (group.getChildByName(event.loader.handle.name) == null)
{

event.loader.handle.ownCanvas = true;
event.loader.handle.rotationX = 90;

group.addChild(event.loader.handle);

}

else
{

event.loader.handle.ownCanvas = true;
event.loader.handle.rotationX = 90;

group.removeChildByName(event.loader.handle.name);
group.addChild(event.loader.handle);

}



camHover.target = event.loader.handle;

}

That's just some quick code I've hack together but once I load it I'm
sure I need to access the material from there right?

desgraci

unread,
Aug 19, 2009, 1:42:38 PM8/19/09
to away3d.dev
well yes, or try at least for testing to assign the materials manually
if ure not sure how to do it whit ur fast method, the thing is to set
ur mats precision. that has a very good chance to correct your problems

StarbuckZero

unread,
Aug 19, 2009, 8:48:09 PM8/19/09
to away3d.dev
It's auto loading all the images from a folder for the 3ds file. So
how do I go about changing the precision once they are loaded in?

desgraci

unread,
Aug 19, 2009, 10:41:49 PM8/19/09
to away3d.dev
ok just for test, make a material for an element of your .3ds model.
Then u asign that material to the corresponding children of the the
3ds (get the child and put it into i dunno; to be honest i made that
some time ago, ill give u code tomorrow, almost midnight in my
country :p; an object3d) remove the child from the .3ds, assign the
new material to the child u saved into the object3d and add that child
now to the .3ds model, after that add the new remade .3ds model thing
to the scene.

theres a lot of ways of doing this, im just giving mine, if someone
else knows, be happy and sure to help, as i said dont remember well,
is not hard dont worry.

the distorsioned textures are fixed by the precision properties, about
the holes, im not so sure, it sounds more like a problem with the
faces, but if is the UV (u see em well in the 3dmax), then the
precision will fix it too.

desgraci

unread,
Aug 20, 2009, 11:21:14 AM8/20/09
to away3d.dev
this example is ho to set the textures apart in a .dae, very similar
to the .3ds:

iguanaModel = Collada.parse(iguanaModelClass,
{x:-900,y:-90,z:-995,materials:
{alpha_png:iguana2BitmapMaterial,body_jpg:pruebaMateria5}});

here u can set the elements with different materials, that uve already
made. but lets say is imposible in .3ds, (im sure u can do something
like this, but just in case...), u can get the childs like this:

mesh1= iguanaModel.getChildByName("Cube") as Mesh;

modify the like this:

mesh1.rotationX=160;
mesh1.material=precitionMat;

and after that put them back:

iguanaModel.addChild(mesh1 as Object3D);
scene.addChild(iguanaModel);

i work my scenes like this, never had a problem with this, ofc, as
always this is the way that works for me, i knwo theres a lot of ppl
with better and faster ways, just trying to help, so if u know one
better or have the code already made for .3ds help :p.

let me know if the precision solved all ur problems.

Rob Bateman

unread,
Aug 21, 2009, 5:28:56 AM8/21/09
to away3...@googlegroups.com
Hey StarbuckZero

you can access the materials auto loaded into a model from a 3ds or collada file by using the materialLibrary property on teh resulting root container of the object. eg:

myColladaContainer.materialLibrary.getMaterial("myMaterialName");

you may need to cast the returned object to the correct marterial type (usually bitmapmaterial), after that you can set precision etc as you would normally

hth

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

StarbuckZero

unread,
Aug 26, 2009, 11:16:22 AM8/26/09
to away3d.dev
It returns null when I try to type cast it.
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

StarbuckZero

unread,
Aug 27, 2009, 11:07:25 AM8/27/09
to away3d.dev
I'll play around with it some more but I'm pretty sure I can get it at
this point. I'll let you know when I got it working.

On Aug 21, 5:28 am, Rob Bateman <rob.bate...@gmail.com> wrote:
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

StarbuckZero

unread,
Aug 28, 2009, 9:37:38 AM8/28/09
to away3d.dev
I just want people to know I figured it out. I had to set the repeat
prop to true once everything was loaded. It's a pretty crazy problem
but I guess I'll make it so people using the 3D file viewer I've
created set everything via an XML file. What I did was copy and pasted
below, once again thanks for the help everyone.

(loader.materialLibrary.getMaterial("Material").material as
BitmapMaterial ).repeat = true;

-Erick

On Aug 27, 11:07 am, StarbuckZero <erick.feil...@gmail.com> wrote:
> I'll play around with it some more but I'm pretty sure I can get it at
> this point. I'll let you know when I got it working.
>
> On Aug 21, 5:28 am, Rob Bateman <rob.bate...@gmail.com> wrote:
>
> > Hey StarbuckZero
>
> > you can access the materials auto loaded into a model from a 3ds or collada
> > file by using the materialLibrary property on teh resulting root container
> > of the object. eg:
>
> > myColladaContainer.materialLibrary.getMaterial("myMaterialName");
>
> > you may need to cast the returned object to the correct marterial type
> > (usually bitmapmaterial), after that you can set precision etc as you would
> > normally
>
> > hth
>
> > Rob
>
> > On Thu, Aug 20, 2009 at 4:21 PM, desgraci <ierafaelper...@yahoo.com> wrote:
>
> > > this example is ho to set thetexturesapart in a .dae, very similar
Reply all
Reply to author
Forward
0 new messages