CP2060
This page was written by Jon Roberts. I've
copied it here (1) so I can pretend like it's mine & take credit (2) because
Jon's no longer at JCU, so his website will probably be removed soon. Cheers
Jon.
Links for 3D Graphics and OpenGL:
News:
- The due date for the assignment is approaching pretty fast, so GET CODING!
- Eugene & I both made solutions for the week 5 tute with the robot arm.
Here is Eugene's solution. Mine is better,
but I'm not going to give you a link to it, because you'll possibly copy it
in your assignment. :-)
- Eugene and I have made sure glut is "installed" for Visual C++
6 (and .NET, but we don't recomment .NET) on the new image.
Links to tutorials and other cool 3D stuff:
Tips:
- Right click "Go To Definition of ..." on any gl, glu or glut
function to see list (.h file actually) of all functions in that library &
paramters they need. Beats looking it up manually.
- Easiest way to "rotate around" your object/world can be as
easy as adding a glRotate(yRot,0,1,0) at the very beginning of your display
- therefore rotating your whole world, but leaving your lookAt function (camera)
alone.
- Have a look at my two cp2060 downloads (downloads section).
- Someone who had done cp2060 gave me some little pieces of advice before
I started, and I'm glad they did. You don't want to get too carried away on
this project (to the point of failing everything else), but it's nice to end
up with a piece of code that your proud of. Not just because your 3d creation
looks good, but because the code is good.
- By doing things well the first time, making it clean, using comments, and
avoiding spagetti, you'll save time and have a better project by the end.
Trust me. You'll also find splitting the project into several files makes
it much eaiser as your amout of code increases.
- If you know about object oriented programming, make sure you use them! By
having a person class (and think about point and bodyPart class(es) too),
you can generate as many people objects as you want. If however, you do everything
procedurally from the beginning (eg: having global functions and variables
like: personPosX & makePersonMoveAlongX(int _amount)) then its bloody
awkward.... it will be VERY hard to re-use and/or change this code later on.
- You probably won't get taught about hierarchial models (ie: trees) until
late in the course; by which time it's probably too late to change your code.
But if you read up about it early on, you'll find it's actually the best way
to represent and draw models. Each body part represents a node, and you traverse
through the tree, drawing each part as you go. If your not a strong progammer,
you should probably omit this though. It's another one of those things which
will be hard to change later on.
- I'd show you my own code if I could, but hey; people would just copy it
then. But you
can find an executable version on my webpage (in the downloads section). It
includes some fragments of code you might find useful (once you start getting
good with c++ and glut), including a good piece of code (function) to let
you load a bitmap image and use it as a texture, I stole from some poor sod.
Having the option to open or save to a file (using the windows open dialog)
is also very cool and not many lines of code. It might also help illustrate
how classes & trees works (err.... a little).
- I found Lindsay was a really good lecturer. In fact, even people who usually
hated teleconferencing enjoyed his lecturers. I got a LOT out of this subject,
so hopefully you people will too. :-)