well any info you can add may help. this is driving me nuts heres the texture and brush setup bit im using
utex$=c_tn
b3dwriteString( utex$) ;texture file
b3dWriteInt( 1+16+32 ) ;flags
b3dWriteInt( 2) ;blend 2
b3dWriteFloat( 0 )
b3dWriteFloat( 0 )
b3dWriteFloat(1.0/ layertexscale(i));x scale 1
b3dWriteFloat(1.0/ layertexscale(i));y scale 1
b3dWriteFloat( 0 ) ;rotation 0
b3dWriteString( "detailmap.jpg") ;texture file
b3dWriteInt( 1+65536) ;flags(second chan)
b3dWriteInt( 2) ;blend 2
b3dWriteFloat( 0 )
b3dWriteFloat( 0 )
b3dWriteFloat(.05) ;scale x. not being recognized
b3dWriteFloat(.05) ;scale y not being recognized
b3dWriteFloat( 0 ) ;rotation 0
Next
b3dEndChunk() ;end of tex
b3dBeginChunk( "BRUS" )
b3dWriteInt( 2 ) ;textures per brush
For i=1 To numlayers
b3dWriteString( "brush_"+i ) ;name
b3dWriteFloat( 0 ) ;red
b3dWriteFloat( 0 ) ;green
b3dWriteFloat( 0 ) ;blue
b3dWriteFloat( 1 ) ;alpha
b3dWriteFloat( 0 ) ;shininess
b3dWriteInt( 1 ) ;blend
b3dWriteInt( 2) ;FX
b3dWriteInt( 0 ) ;used texture index1
b3dWriteInt( 1 ) ;used texture index2
Next
b3dEndChunk() ;end of BRUS chunk
and heres the vertex portion
b3dBeginChunk( "VRTS" )
b3dWriteInt( 3 ) ;flags - 0=nonormal/color
b3dWriteInt( 2 ) ;2 tex_coord sets
b3dWriteInt( 2 ) ;2 coords per set
surf=GetSurface( omesh,1 )
n_verts=CountVertices( surf )-1
For j=0 To n_verts
b3dWriteFloat( VertexX( surf,j ) )
b3dWriteFloat( VertexY( surf,j ))
b3dWriteFloat( VertexZ( surf,j ) )
b3dWriteFloat( VertexNX( surf,j ) )
b3dWriteFloat( VertexNY( surf,j ))
b3dWriteFloat( VertexNZ( surf,j ) )
b3dWriteFloat( VertexRed(surf,j)/255)
b3dWriteFloat( VertexGreen(surf,j)/255)
b3dWriteFloat( VertexBlue(surf,j)/255)
b3dWriteFloat( VertexAlpha(surf,j))
b3dWriteFloat( VertexU#( surf,j,0 ) )
b3dWriteFloat( VertexV#( surf,j,0 ) )
b3dWriteFloat( VertexU#( surf,j,1 ) ) ; lightmap uv
b3dWriteFloat( VertexV#( surf,j,1 ) ) ; lightmap uv
Next
b3dEndChunk() ;end of VRTS chunk
|