This is the function of a First Person-Third Person Camera for OpenGL.
Read more »
Today I spent the morning (9:30 AM - 3 PM) porting AS3D to GLUT. I found that it was possible, but not positive. I downloaded the GlutMaster pseudo-library interface for glut. I figured it out in less than half an hour, it was really simple. So I added it to AS3D as version 0.11.0. It just would not compile. gcc works fine, but ld does not. Why? Why?! It took me four hours to find out. Ugh. So I finally have the brilliant idea to compile it invertly: take a working GLUT sample and add a single small part of AS3D. Same problem. So then I check the makefile. The makefile isn't compiling my AS3D class. I look in the problem in the AS3D and what do you know, it's not compiling the glutMaster. Duh, that would give an error. So I spend another half hour finding out that a quirk in KDevelop made it not compile it due to directory structure and file extention (glutMaster.c++ instead of glutMaster.cpp). Very silly, indeed. So then I have it running, right? No. Glut is built incorrectly for my program. While I do use a mainloop, I have multiple levels of returns due to my correct* use of C++. It is event-based where my program is object based. It controls the loop with this function called glutMainLoop. If you want to sidestep glut, there's a website with instructions on how to hack it. I don't want to hack glut. Sure, you may find it fine, and if I really wanted to use glut, I would, but I do not. You see, I checked a bit of source code for SDL on NeHe and I'm going to use it. Thanks Jeff and Ti Leggett! You might remember that I used NeHe source code for my Milkshape Model Loader and my Linux GLX base code (which I am now rewriting in SDL).
Exciting times here at AltSci. I wasn't able to do either Particle Works, polygon reduction in Terrain Works, or Collision detection this five day weekend, but the things that I did accomplish were quite enough. Today I was able to finish the tar and gzip support for AltSci3D. I got it to run using a data.tar.gz file. What was cool was the way I went about it. I wrote a very short testing program using my cpp_arg class and a TarFile class. int main() simply grabbed a tar, parsed it, and gave you the contents of the file you asked for. When I finished, I renamed it tcat. Why tcat? Have you used Linux before? There's a command called cat. It opens a file and returns the contents to the console. It's very useful, especially with the Linux console which is so mighty and powerful (specifically pipelines and in/output redirection). Well, there's also a program called zcat. It takes a file.gz and decompresses it outputting the contents to the console. It's very useful when you are using gzipped files. Why do you use gzipped files? That is the lesson for today, but not yet. Before I release it, I am going to get support for all files in the data.tar.gz file. That way the AS3D data is self-contained. What use is that? Say you want to show your AS3D manga to a colleague? Send him/her this one .tar.gz and then they can just drop it onto AS3D and it will show up. Currently it's kinda weird and stuff. Everything is relative path and it doesn't work unless you run it from the console in the directory above the data directory. Ugh, huh? Well, this will allow easy access to good directory structure. And since I still have support for files as it was in old, I think it will be good. Backup is good.