How i can change or switch a texture of a 3DS object plz.

Blitz3D Forums/Blitz3D Programming/How i can change or switch a texture of a 3DS object plz.

Kissme(Posted 2004) [#1]
Hi all,

I receive a 3DS file, it's a little char he is assembled and have 3 parts :

-Head
-Body
-Legs

and my question it's how i can apply a texture for the different part (head or body) ? but i try this and that not work :

Load character model.
gentChar = LoadAnimMesh("char.3ds")
ScaleEntity gentChar, 5,5,5
PositionEntity gentChar, 0,-15,45
texChar = LoadTexture( "Face.png", 1+256 )
EntityTexture gentChar, texChar

...

Thanks you alot for helping !

And kiss ya !
Stephanie


TeraBit(Posted 2004) [#2]
The character is probably made up of textured surfaces.

You will need to assign a texture to a blitz brush and then paint the individual surfaces of the mesh.

i.e. something along the lines of:
surf = getsurface(GentChar,1) ; Could be a number of surfaces!
Br = GetSurfaceBrush(Surf)
BrushTexture Br,Texchar
PaintSurface Surf,br


GfK(Posted 2004) [#3]
Nothing so complicated (assuming the mesh has UV coords and the objective is to apply a different texture).

For N = 1 to CountChildren(gentChar)
  EntityTexture GetChild(gentChar,N),TexChar
Next
That should do it. The problem is, when 3DS objects are loaded with LoadAnimMesh, a 'pivot' is created then the model segments are the next step down the hierarchy. Odd, but there it is.


Kissme(Posted 2004) [#4]
Woot that work thanks you alot TeraBit and Gfk ! and iam sorry i have a new question :-(

I have this .3DS animated char, it's easy to make it's animated like MD2 format ?

For animating frame 46 to 53 i used this :

AnimateMD2 gentCharacter, 3, 0.4/2,46, 53, 10

now i don't know how to doing with this crap .3DS file hihihih

THANKS YOU AGAIN !!

Kiss ya all
Stephanie


GfK(Posted 2004) [#5]
MD2 and B3D format support deformable meshes - 3DS and X don't. So the only way you can animate 3DS and X, is to either A) Convert it to B3D, or B) keep it segmented (for example, the upper and lower arm would have to be a separate object).

I'd recommend converting to B3D.


Kissme(Posted 2004) [#6]
Gfk sorry for my little english :) i know how many frames i have in my .3DS file and i know all sequence (Run, working, attack...)

I wan just to know how i can tell at blitz like a command :
AnimateMD2 gentCharacter, 3, 0.4/2,46, 53, 10

for he animating my 3DS sequence frame 46 to 53.

Thanks you again for helping.

Kiss ya
Stephanie


GfK(Posted 2004) [#7]
Sorry - misunderstood.

You'd use the "Animate" command instead of AnimateMD2. To play specific frames you need to use ExtractAnimSeq first though.


Kissme(Posted 2004) [#8]
Doh that work damned thanks you alot dear GFK !!!!

All best for you !

Kiss ya
Stephanie