Colors and 3D Models

Blitz3D Forums/Blitz3D Beginners Area/Colors and 3D Models

AuzingLG(Posted 2004) [#1]
Hello!
I have a 3D model with colors and textures.
But when I show it in Blitz, the most of the colors don't appear! My code:

Type boter
Field name$
Field file$
Field dsrc$
Field model
End Type

[...]

player.boter = New boter
dfile = ReadFile(mybot$)

player\dsrc$ = mybot$
player\name$ = ReadLine(dfile)
player\file$ = ReadLine(dfile)

CloseFile dfile

cam = CreateCamera()

player\model = LoadMesh(path$+"GFX\3D\"+player\file$)
PositionEntity player\model,0,0,5

Cls
UpdateWorld
RenderWorld
Text 0,0,player\name$
Flip

WaitKey

End

My model is in .x format. Can you help me?


(tu) sinu(Posted 2004) [#2]
make sure your textures are in the same folder as your model.


AuzingLG(Posted 2004) [#3]
the textures are in the same folder.
but the colors of the model (not of the textures) don't appear...


Ross C(Posted 2004) [#4]
I'm confused. if you texture something, it textures it. I don't think you can color and texture. You can in blitz. I'm confused :)


AuzingLG(Posted 2004) [#5]
But DOGA L2 does...
what can I do?


Ross C(Posted 2004) [#6]
I'm still not sure what your trying to do. Why don't you just use a texture? And incorparate all the color onto the texture?


AuzingLG(Posted 2004) [#7]
I'm using the same texture with different (material, not on texture) colors on a 3D model. When I open this model with the mesh viewer of the directx (9) sdk, it works but in blitz I see only the texture... doesn't blitz support material effects?


Ross C(Posted 2004) [#8]
No, it doesn't i'm afraid :S I very sure of this. I don't wana say Flat out no tho :)


Anthony Flack(Posted 2004) [#9]
I wouldn't be so quick to say flat out no either - you *can* colour each vertex individually in blitz so there's no reason why this shouldn't work although I've never tried importing the colours with the model.

Have you tried setting the object's entityfx flag 2? (flag 2 is, according to the documentation for entityfx: "use vertex colours instead of brush colour"

put this in after you load the model and see if it helps
entityfx player\model,2



AuzingLG(Posted 2004) [#10]
it doesn't work


Anthony Flack(Posted 2004) [#11]
Hmm, perhaps if you convert your model into a .b3d file format it will do it for you. I'm sure someone can help you out as far as what to do to convert the model format. Because blitz definitely DOES support vertex colouring with texture.


Sledge(Posted 2004) [#12]
If you convert a Doga model to b3d I'm pretty sure you lose the colour... tried it myself a while back but I could be misremembering.


Anthony Flack(Posted 2004) [#13]
Hmm, well there must be some way of doing it. Preferably without having to write a custom loader! I wonder why the colour info isn't being applied to the vertexes properly.


BlitzSupport(Posted 2004) [#14]
Is it a DirectX 7 model, or DX 8/9? Blitz will only import version 7 models...


AuzingLG(Posted 2004) [#15]
erm... I don't know. How to find out?


carpman(Posted 2004) [#16]
Which 3D modelling program are you using? I use 3DCanvas which dosn't seem to export colours when loaded into Blitz. However if you make the colour you want into a texture using a paint program say 32x32 and apply it to the model it should work ok.
>Carpman


AuzingLG(Posted 2004) [#17]
I'm using Doga L2


carpman(Posted 2004) [#18]
I haven,t seen Doga L2 but in the tutorial section of 3DCanvas one of the biggest mistakes is to use colours instead of textures. It's ok to use colours to block in the model initally but these must then be replaced by a texture for best results. If you just fill an area with colour and then decide when it's loaded into Blitz you want to change it, you would have to go back to Doga,change the colour, re-export the model,and then load back into Blitz. You could change the colour from within Blitz also but again not straightforward. However if you make your colour into a texture and you want to change it all you have to do is load it into your paint program, change the colour, save it,job done.
>Carpman


Ross C(Posted 2004) [#19]
I found in 3dcanvas, that when i painted my model different colours, i made them all different surfaces.

Back on topic, is there not an option to bake or combine the vertex colours onto the texture?


carpman(Posted 2004) [#20]
Ross,
>I found in 3dcanvas, that when i painted my model different colours, i made them all different surfaces.

This is because when you apply colours in 3DC you actually apply a mask. If you apply say red to 10 different faces, every time you select red in the materials window it will highlite all the faces of the model coloured red.
>Carpman


Ross C(Posted 2004) [#21]
Oh righte :) I stopped using 3d canvas :)