Materials & Textures

Blitz3D Forums/Blitz3D Programming/Materials & Textures

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I'm sure it's something to do with UV info within the mesh. Only I'm not very techy, and do not understand that sorta stuff!!!

At the moment, the code leaves the mesh bright white. Failing this, it seems to have a texture of its own that isnt linked to an external file. My texture doesn't appear on it at all.

I cannot post my code for you to try because it is all over the place and objects data is read in as types from a file. However,

download
this

and look at the files:

Beta\Libraries\SectorBuild.bb
max_objects=ReadLine (SectorFile)

For bf=1 To max_objects

setup_object.sector_object=New sector_object

setup_object\name$=ReadLine (SectorFile)
setup_object\class$=ReadLine (SectorFile)
setup_object\scaleX=ReadLine (SectorFile)
setup_object\scaleY=ReadLine (SectorFile)
setup_object\ScaleZ=ReadLine (SectorFile)
setup_object\PosX=ReadLine (SectorFile)
setup_object\PosY=ReadLine (SectorFile)
setup_object\PosZ=ReadLine (SectorFile)
setup_object\mesh=LoadMesh("Visual\3d"+setup_object\class$+".b3d")
setup_object\texture=LoadTexture("Visual\3d"+setup_object\class$+"txt.bmp",9)
setup_object\RotX#=ReadLine (SectorFile)
setup_object\RotY#=ReadLine (SectorFile)
setup_object\RotZ#=ReadLine (SectorFile)
setup_object\Shield=ReadLine (SectorFile)
setup_object\Hull=ReadLine (SectorFile)
setup_object\Friend_or_foe=ReadLine (SectorFile)
setup_object\Dock_Here=ReadLine (SectorFile)
TextureBlend setup_object\texture,3
EntityTexture setup_object\mesh,setup_object\texture,0,1
PositionEntity setup_object\mesh,setup_object\posX,setup_object\PosY,setup_object\PosZ
ScaleMesh setup_object\mesh,setup_object\scaleX,setup_object\scaleY,setup_object\scaleZ

NameEntity setup_object\mesh,"Construction"

 Next




Beta\Libraries\Sectors\Sol\Objects.DAT (open in notepad - it's just text)
the following excerpt is the data being read for 'setup_object.sector_object' Type



finally:

Beta\Visual\3D\Station.b3d
and
Beta\Visual\3D\Stationtxt.bmp

These are the mesh and texture files in question. In the game (just execte Beta/Main.bb ) the entity is the space station that is right in-front of the camera :-)


Sorry about the format, hope it's clear - any probs let me know!