Sign in to follow this  
  • entries
    67
  • comments
    114
  • views
    33744

More OpenGL Game Programming

Sign in to follow this  
baldurk

85 views

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.
Sign in to follow this  


2 Comments


Recommended Comments

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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now