I'm currently in interested normalization(sp??)especially the command
set matrix normals()
as far as i can tell using this command makes the matrix it is applied to become effected by light whithout this a matrix would not. I don't need any code but could someone explain how normalising works?? and also if possible why the example in dbc has all this
rem Use matrix normals to make it smooth
for z=1 to 99
for x=1 to 49
rem Get matrix heights
h8#=get matrix height(1,x,z-1)
h4#=get matrix height(1,x-1,z)
h#=get matrix height(1,x,z)
h2#=get matrix height(1,x,z)
rem Calculate projected angle X using heights
x1#=(x-1)*25.0 : y1#=h#
x2#=(x+0)*25.0 : y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
rem Calculate projected angle Z using heights
z1#=(z-1)*25.0 : y1#=h2#
z2#=(z+0)*25.0 : y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
rem Make normal from projected angle
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
rem Setting matrix normal for smoothness
set matrix normal 1,x,z,nx#,ny#,nz#
next x
next z
update matrix 1
when i can just use this
rem Use matrix normals to make it smooth
for z=0 to 20
for x=0 to 20
mx#=x*50
mz#=z*50
set matrix normal 1,x,z,mx#,get ground height(1,mx#,mz#)+20,mz#
next x
next z
update matrix 1
and it seems to work ok?
thanks in advance
ReD_eYe
hi guys