More OpenGL Game Programming

Published November 15, 2005
Advertisement
Well today I received a check in the mail and a complimentary copy of More OpenGL Game Programming BUY ME!.

It's pretty cool, the Authors' names are listed on the back page, and their bios are on a page just inside the cover. Props to Dave and all the other Authors for getting this all finished, it was definitely worth it :D.

I finally got my way back into programming, the catalyst actually being an assignment for computing here. The assignment was pretty mundane, but still interesting (as they all have been) - it was about turtle graphics.

For those of you who don't know, turtle graphics are graphics drawn with simple commands like "Forward 10, Turn 20, Forward 5, Turn -50, Forward 20". The assignment goes on to detail the implementation and a couple of additions like grabbing the colour of the line (RGB triple or "invisible ink") and Branching (so that you can branch off and do something, then come back and carry on from where you branched.

Here's an example: Go 30 :# Turn 120 :# Go 30 :# Turn 120 :# Go 30 (:# simply separates commands) produces:


The assignment then goes on to explain L-Systems a little bit and plays around with them.

The interesting bit comes at the end where it outlines a programming competition - using turtle graphics produce any picture you like by any method. The best one wins a bottle of champagne (or book token equivalent).

My plan is to write a very simple hackish software renderer to project 3D lines down to 2D with perspective, then write a simple procedure with Branches and invisible ink to render the 2D lines. It's actually worked out quite well, although the perspective is a little screwy, it will do:



(OK I know it's a lot screwy, but it's good enough. I'll work on it some more and see if I can improve it if I have time).

Anyway, given that I just finished writing a chapter on procedural generation of trees, and the assignment includes details on L-Systems, I thought it'd be nice to generate a random 3D tree on a plane maybe with some grass. I figure that's better than generating a julia set or whatever boring fractal :P.
Previous Entry Graphics card
Next Entry 3D LOGO!
0 likes 2 comments

Comments

benryves
Hooray for LOGO! Years ago I wrote a very basic adventure game in LOGO (on the BBC Master 128) with lots of cut scene images made up by steering the turtle around.
November 15, 2005 10:15 AM
........................................
actually I like the perspective very much :) good work
November 15, 2005 11:15 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement