EntityTexture Question

Blitz3D Forums/Blitz3D Programming/EntityTexture Question

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 am working on the same type of program.
What I came up with is I created a mesh and then made copies of it to use as terrain tiles.
Each tile has it's own texture. I also made random textures to use for the tiles. Here's my tile function.


Function CreateTile1() ;Create one tile and return for storage in tile array

Local m=CreateMesh() ;temp mesh
Local ss=CreateSurface(m) ;,b ) ;temp surface

For nx=0 To 27
For nz=0 To 27
V(nx,nz)=AddVertex(ss,nx,0,nz,(nx*0.0352),(nz*0.0352),0 );create all vertices
Next
Next

tt=0
For x=0 To 26 Step 2 ; 0-6 has 16 triangles (16x16=256)
For z=0 To 26 Step 2 ;

t(tt)=AddTriangle( ss,V(x,z),V(x,z+1),V(x+1,z) ) ;
tt=tt+1
t(tt)=AddTriangle( ss,V(x+1,z),V(x,z+1),V(x+1,z+1) )
tt=tt+1
If z< 26 Then t(tt)=AddTriangle( ss,V(x,z+1),V(x,z+2),V(x+1,z+2) )
tt=tt+1
If z< 26 Then t(tt)=AddTriangle( ss,V(x+1,z+2),V(x+1,z+1),V(x,z+1) )
tt=tt+1
If x<26 Then t(tt)=AddTriangle( ss,V(x+1,z),V(x+1,z+1),V(x+2,z+1) )
tt=tt+1
If x<26 Then t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+2,z),V(x+1,z) )
tt=tt+1
If z<26 And x<26 Then t(tt)=AddTriangle( ss,V(x+1,z+1),V(x+1,z+2),V(x+2,z+1) )
tt=tt+1
If z<26 And x<26 Then t(tt)=AddTriangle( ss,V(x+2,z+1),V(x+1,z+2),V(x+2,z+2) )
tt=tt+1

Next
Next

Return m

End Function
This creates a 27x27 unit mesh.
The If .. Then statements are only needed for an odd sized tile.
If you use an even size for your tiles, you can leave them out.
I placed 1 tile at the centre and then placed 8 around it in a ring.
I then scale the mesh x 3 and make a ring around preveous 9 tiles.
I did this for 8 rings each 3 times bigger tiles then the preveous.
I have a viewing area that's 88,000 units out from my centre and it renders at more then 300 fps in debug mode.
This may help you out. I am looking for people that have a similar goal as me to design an awsome outdoor world.
That's why I am passing this on to you.
I may get new ideas from you too.