Hi Ian,

The purpose of an OpenGL list is to speed up execution of a constant sequence of OpenGL commands -- like drawing all the triangles of the rabbit. You record the list once, the OpenGL driver stores it in a very optimized chunk of data, and then you can recall the list as many times as needed.

So, creating the list at every rendering operation is both pointless and wrong, since it will progressively take up memory, filling video and/or main memory.

You should create the list once at the first execution of your patch and then just call it at every subsequent rendering. Do not forget to delete the list in patch cleanup code.

Look for glNewList in any search engine for more information.

By the way, you can safely use any C code in Obj-C as it is a strict superset of C.

Regards,

Ambroise

Le 14 nov. 07 à 00:54, Ian Grant a écrit :

Houston, we have the bunny.

<Quartz ComposerScreenSnapz001.png>


I am not sure how I did it, and I am sure I haven't done it correctly or optimally - creating a glList thing from the model data WITHIN the execution method (does that make sense?). I'd love some advice or an example of how this should be achieved (now I sort of understand it).

The rabbit doesn't spin elegantly. Kind of jerky.

But I was pretty pleased when I saw the rabbit.

Regards, Ian
*******************************
Ian Grant
Senior Lecturer in Digital Art
Faculty of the Arts
Thames Valley University
Ealing, UK
W5 5DX
<[EMAIL PROTECTED]>
*******************************



On 12 Nov 2007, at 22:25, Ian Grant wrote:

Hi all,

I know that this may be a big ask and a little long winded:

I am trying to learn OpenGL (using the OpenGL SuperBible 4th Edition). For a learning project I aim to get the Stanford Bunny appearing in a QC custom patch.

To this end, I have dissected the following sample code:

FBOBunnies

and isolated the code that renders the (non fbo) stanford bunny and cleared the project of all other code. This was useful to deconstruct the example and separate the glut from the gl etc. I've been learning obj-c and cocoa for a couple of years and don't really come from a C background.

Then: I dissected:

GLSquarePlugin

identified the spot where the quad is drawn (!) and thought I might be able to mash up the code.

I can see the results of a glClear!

Currently, I lack the knowledge / experience to know how the magic glCallList(dlist[DLIST_BUNNY]) renders the model data and whether calling C functions happens seemlessly in an obj-c context.

        dlist[DLIST_BUNNY] = GenStanfordBunnySolidList();       
        glEndList();
        glCallList(dlist[DLIST_BUNNY]);

I may also be missing something basic in the opengl setup or a glFlush or something else to draw to the screen.

With the stanford bunny amendments, the QC custom patch, builds with no errors - but I guess I haven't got the model drawing code right.

The project attachment was declined by the listserv so I put it here: <http://ellington.tvu.ac.uk/downloads/ GLSquare_Model_Import.zip>

I thought if I could get model data rendering, I may be a short step away from constructing an OBJ importer! ;-)
Or at least having a QC bunny to play with.

I'll happily share any projects and material I've got so far, should they help anyone else.

But any hints would be great.

Kind regards, Ian

*******************************
Ian Grant
Senior Lecturer in Digital Art
Faculty of the Arts
Thames Valley University
Ealing, UK
W5 5DX
<[EMAIL PROTECTED]>
*******************************
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/ian.grant%40mac.com

This email sent to [EMAIL PROTECTED]


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected] )
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/ambroise%40cellulo.info

This email sent to [EMAIL PROTECTED]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to