i counted all of the "(" and ")" and found there all in order so when i try to correct the problem (adding a ")" ot the end of the line) it as for more of them
it seams that it nevers ends (i stopped adding after i added 300)
so i'm am thinking that this is a compliler bug and i want to make sure it is.
heres the procedure and all of the "dim" code
Code: Select all
#HW_limit.l=1000000
Dim normal_vector1(2)
Dim normal_vector2(2)
Dim normal(2)
Dim face_center(2)
Dim rtemp(#HW_limit)
Dim O_face_num(#HW_limit)
Dim O_vertex_X(#HW_limit,#HW_limit)
Dim O_vertex_Y(#HW_limit,#HW_limit)
Dim O_vertex_Z(#HW_limit,#HW_limit)
Dim O_face_vertex(#HW_limit,#HW_limit,3)
Dim O_X.f(#HW_limit)
Dim O_Y.f(#HW_limit)
Dim O_Z.f(#HW_limit)
Procedure Drake_BFaceCulling()
;"BFaceculling" or Back Face Culling, it bassicaly removes all of the faces that are not pointing at the camrea
; the faces that are pointing at the camrea are put into a Rendering list for Zsorting then to rendering
; i cannot explain thsi very well because i don't fully understand it yet...never the less it works
For O=0 To O_num
For F=0 To O_face_num(O)
normal_vector1(0)=O_vertex_X(O,O_face_vertex(O,F,0))-O_vertex_X(O,O_face_vertex(O,F,1))
normal_vector1(1)=O_vertex_Y(O,O_face_vertex(O,F,0))-O_vertex_Y(O,O_face_vertex(O,F,1))
normal_vector1(2)=O_vertex_Z(O,O_face_vertex(O,F,0))-O_vertex_Z(O,O_face_vertex(O,F,1))
normal_vector2(0)=O_vertex_X(O,O_face_vertex(O,F,2))-O_vertex_X(O,O_face_vertex(O,F,1))
normal_vector2(1)=O_vertex_Y(O,O_face_vertex(O,F,2))-O_vertex_Y(O,O_face_vertex(O,F,1))
normal_vector2(2)=O_vertex_Z(O,O_face_vertex(O,F,2))-O_vertex_Z(O,O_face_vertex(O,F,1))
normal(0)=normal_vector1(1)*normal_vector2(2)-normal_vector1(2)*normal_vector2(1)
normal(1)=normal_vector1(2)*normal_vector2(0)-normal_vector1(0)*normal_vector2(2)
normal(2)=normal_vector1(0)*normal_vector2(1)-normal_vector1(1)*normal_vector2(0)
face_center(0)=O_X(O)+(O_vertex_X(O,O_face_vertex(O,F,0))+O_vertex_X(O,O_face_vertex(O,F,1))+O_vertex_X(O,O_face_vertex(O,F,3)))/3
face_center(1)=O_Y(O)+(O_vertex_Y(O,O_face_vertex(O,F,0))+O_vertex_Y(O,O_face_vertex(O,F,1))+O_vertex_Y(O,O_face_vertex(O,F,3)))/3
face_center(2)=O_Z(O)+(O_vertex_Z(O,O_face_vertex(O,F,0))+O_vertex_Z(O,O_face_vertex(O,F,1))+O_vertex_Z(O,O_face_vertex(O,F,3)))/3
length_normal=Sqr((normal(0)*normal(0))+(normal(1)*normal(1))+(normal(2)*normal(2)))
length_center=Sqr((face_center(0)*face_center(0))+(face_center(1)*face_center(1))+(face_center(2)*face_center(2)))
normal(0)=normal(0)/length_normal
normal(1)=normal(1)/length_normal
normal(2)=normal(2)/length_normal
face_center(0)=face_center(0)/length_center
face_center(1)=face_center(1)/length_center
face_center(2)=face_center(2)/length_center
f_dir_v=(normal(0)*face_center(0))+(normal(1)*face_center(1))+(normal(2)*face_center(2))
If f_dir_v < 0
rtemp(O,F)=1
Else
rtemp(O,F)=0
EndIf
Next F
Next O
EndProcedure

