if this helps … . my code is approximately:
;somewhere before this i set a variable called contour list to
(setf contour-list ((((x y z)(x y z)(x y z))((x y z)(x y z)(x y z))etc…) etc . . . )
–>in lisp the parenthesis signify a linked list. the important thing to understanding lisp, is that it doesn’t matter how it’s stored in memory (in lisp, the computer takes care of memory management, not the human), what’s important is that the following is a linked list: '(1 9 'a 'b 4.5 x y z “string” #'my-function), and mixed varaible types are allowed, and you can even store functions in a linked list if you want. ta da. poof! its a linked list. just because i wrote the paranthesis. (it’s a whole lot easier then C isn’t it?)
then I have:
(gl:glBegin gl:GL_TRIANGLES)
(dolist (contour contour-list)
(dolist (triangle contour)
(dolist (pt triangle)
(eval`(gl:glVertex3d ,@pt)))))(gl:glEnd)
-> what this means: the dolist is a way of parsing off the outermost parantheis and then scrolling through all the elements. the first argument after dolist is the variable that is being set in each loop, the second argument is the list. so contour-list is a list of contours. contours is a list of points that are supposed to be interpreted that every three points are a triangle. pt is a list of x y z coordinates. ,@ means to remove the elements from a list and use each element as individual arguments. more or less, I have that structure because it isn’t any harder for me to write a list of lists of lists, then it is to write one list, and it’s easier for me to read the points and know whats going on with the lists of lists. it’s a linked-list so i don’t have to worry about size, and in lisp making a linked list is as easy as writting paranthesis around what u want a list of.
in C/C++ this is basicly a cute way of:
glBegin (GL_TRIANGLES);
for(x = 0; x++; x >= size of array)
glVertex (array[x 0], array[x 1], array[x 2]);
glEnd;
But, it doesn’t really matter what the points are, how they got there, or what my code looks like. To my understanding GL_TRIANGLES can only make triangles . . . . this is the only time when glBegin is called in any of the 50,000 lines of this program … . . . so how come a see squares sometimes??? this was before there was any lighting … . there was perpective. . .but to my understanding perspective makes things look smaller in the distance (i.e. more triangular). . .not squarish. my code is supposed to put what would normally be called with triangle-strips and triangle-fans on the screen (but i don’t want to write the code to sort out which sets of points are fans and which are triangles. . .thus i’m using glTriangle).
In summation, my question is: Where I should see triangle-strips like objects, I see squares. Why?
[This message has been edited by jenny (edited 08-17-2002).]