I'm just starting to build a large object but before I move on I'm wondering not just about the normals but at the moment the UV coords.
If I can get away with using 1 texture (with three images tiled above each other ie 256x768), then hopefully I can get away with creating separate objects for floors, walls and ceilings.
What UV values would I need to use to split one image into three values?
Portions of the creation code so far:
function MAP_MAKE_3D(mapID)
` STEP 1 - make vector array map and count them all
` *------------------------------------------------*
mwid=_MAP(mapID).wid : mhgt=_MAP(mapID).hgt ` *OPT*
dim v() as VEC3
dim vmap(mwid,mhgt) as VEC_MAP_DATA
`voff=0 ` current vector offset
` init groups array to count vertices and faces
dim vg( _MAP(mapID).groups) as VEC_GROUP_DATA
x=1
while x<mwid
y=1
while y<mhgt
pos=_MAP(mapID).pieces + x + ( y * mwid ) ` *OPT*
if _PCS(pos).piece <> 65535
group=_PCS(pos).group
vcnt=8
flags=255
vmap(x,y).offset=vg(group)
if _PCS(pos-mwid).group = group
` sharing piece aboves vectors
flags=LBL + LBR + UBL + UBR
vcnt=4
endif
if _PCS(pos-1).group = group
` remove vertex refs to shared vectors
if flags and LTL
flags = flags and (255 - LTL - UTL)
vcnt=vcnt - 2
endif
flags = flags and (255 - LBL - UBL)
vcnt=vcnt-2
endif
else
vcnt=0
flags=0
vmap(x,y).offset=-1
endif
vmap(x,y).count=vcnt
vmap(x,y).flags=flags
vg(group).voff = vg(group).voff+vcnt
` Count number of faces for the current groups piece
inc vg(group).cnt_floor
fc=0 ` face count start (floor and ceiling)
if _PCS(pos-1).piece=65535 ` check left
inc fc
endif
if _PCS(pos+1).piece=65535 ` check right
inc fc
endif
if _PCS(pos-mwid).piece=65535 ` check up
inc fc
endif
if _PCS(pos+mwid).piece=65535 ` check down
inc fc
endif
vg(group).cnt_wall=vg(group).cnt_wall+fc
inc y
endwhile
inc x
endwhile
` STEP 2 - write out stats for the vertex groups
` *------------------------------------------------*
x=0 : y=0
while x < _MAP(mapID).groups
y=y+vg(x).voff
TRACE_WRITE("Group - "+str$(x)+" has "+str$(vg(x).voff)+" vertices.")
inc x
endwhile
TRACE_WRITE("Total vertices - "+str$(y))
` STEP 3 - Create vertex and index lists ready for creation
` *------------------------------------------------*
make object new vg(group).obj_floor,vg(group).voff,vg(group).cnt_floor,274,0
endfunction
If I can't use one image then I would have to go the long way round and create 3 separate objects and add them as limbs. I'm trying to massively reduce the amount of vertices used in the objects and share them with other faces...
Warning! May contain Nuts!