We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › OPENGL where to start Recomended Book/websites
Page Index Toggle Pages: 1
OPENGL where to start? Recomended Book/websites (Read 798 times)
OPENGL where to start? Recomended Book/websites
Mar 22nd, 2008, 10:33pm
 
Hi everyone, i've only been using processing for a month after not writing a single line of code for a whole decade.  I've absolutely fallen in love with coding again, processing has let me do amazing things in such a short period of time. I've been able to wire together all my midi equipment and controllers. I was even able to use parameters from my virus synthesizer to create visuals, Amazing! in only one monthQ  I can't express enough gratitude to it's creators.  

I've coded my own obj loader and made a few sketches for me to use as a vj but noticed that processing starts to crawl once you start throwing alot of vertex info at it. I've got a beast of a system (dual core 3.2ghz 4gb ram 8800 ultra) so its not my machine.  I've come to the conclusion that to be able to get some serious power i need to start using opengl calls, call list, vertex shaders etc.  The problem is i don't know where to start.  I've bought the two books on processing and they really helped, i'm looking for any recommendations for good books on opengl, ideally something that also deals with processing(i've looked and haven't found anything).  I've got an official opengl bible and reference book but they're like 8 years old and the material is pretty dry.  If anyone could point me in the right direction i'de really appreciate it.

thanks,
Stephen
Re: OPENGL where to start? Recomended Book/website
Reply #1 - Mar 23rd, 2008, 12:40am
 
I got a copy of the OpenGL Superbible (http://www.amazon.co.uk/OpenGL-Super-Bible-Richard-Wright/dp/0672326019/ref=pd_bbs_12?ie=UTF8&s=books&qid=1206226958&sr=8-12) a couple of years ago, and it covers everything up to and including shaders in GLSL (though it doesn't go into much detail with shaders, just some basic how to use them stuff really)

If you're interested in throwing large ammount of vertex data around, I do have a .obj loader for OpenGL that I kept meaning to build into a library, but have never found the time, maybe you could use the source to help learn stuff.

The main limitation is that it expects .obj files of a certain format, that is to have normal data and texture data for all verticies, and for all polys to be triangles, so the  face line reads "f 1/1/1 2/5/3 12/3/4" for instance and no missing values.

You can see the code here:
http://www.hardcorepawn.com/ObjLoad/ObjLoad.pde
http://www.hardcorepawn.com/ObjLoad/dotOBJ.pde

There is an applet in http://www.hardcorepawn.com/ObjLoad/ however it seems to crash my browser when I try to use it.. seems that OpenGL stuff can still be temperamental.
Re: OPENGL where to start? Recomended Book/website
Reply #2 - Mar 23rd, 2008, 2:15am
 
Thanks John, i'll check out the super bible.  I Started reading the online programming guide and reference manual today, opengl's not so scary any more.  Thanks for the sample code, i actually found it on a previous post and have been dissecting it.  One thing that i'm a little  confused on is the use of processing functions such as traslate rotateX, lighting and shape functions when using opengl.  I take it that processings functions don't work when using any gl. commands so i guess i'll have to rewrite all the code i made to handle my cameras, etc.
Re: OPENGL where to start? Recomended Book/website
Reply #3 - Mar 23rd, 2008, 10:15am
 
Processing ones work fine as long as you wrap the GL calls in beginGL()/endGL() calls.

e.g. you can do
Code:
camera(.....);
translate(...);
gl=((PGraphicsOpenGL)g).beginGL();
//some GL stuff
((PGraphicsOpenGL)g).endGL();
translate(...);
rotateX(..);
((PGraphicsOpenGL)g).beginGL();
//more GL stuff
((PGraphicsOpenGL)g).endGL();
Re: OPENGL where to start? Recomended Book/website
Reply #4 - Mar 23rd, 2008, 4:08pm
 
I kind of figured it out,  Gl objects weren't displaying because i needed to use the gl matrix mode.  What do the beginGL()/endGL() calls do?  and i tried using rotate and translate but nothing happens to any of the gl stuff  but glTranslatf and glRotatef work fine.
Re: OPENGL where to start? Recomended Book/website
Reply #5 - Mar 23rd, 2008, 4:23pm
 
beginGL takes all the procesing transformations and sets the GL matricies to the equivalent values as if you'd done GL calls instead.
Re: OPENGL where to start? Recomended Book/website
Reply #6 - Mar 23rd, 2008, 4:44pm
 
sweet, so i don't have to screw with Matrixmode glperspective and all that stuff.  Thanks for all the info john i really appreciate it. Now that i've got that all cleared up i'm back to reading my superbible (Happy)
Page Index Toggle Pages: 1