Articles

REPLACEMENT FOR GLUPERSPECTIVE

For those interested, I have coded a replacment for gluPerspective so people can do away with dependancies on glu as well as glut!

 

DEALING WITH CODER'S BLOCK

Evil Hamster Games 2K3

Okay, everyone that has ever worked on a game or application in any language knows what coder's block is. It is not easy to deal with. Getting paid to work on the project is an excellent motivator, however, this is most likely not going to happen. I am going to share with you some of the ways I deal with it.

USING GLUUNPROJECT

gluUnProject converts Windows screen coordinates to OpenGL coordinates. This means that you can get the position of your mouse on an OpenGL Window and use this method to find the x, y and z coordinate of where you clicked.

You need to pass several variables to the function, these are:

1. Viewport Origin And Extent
2. The Modelview Matrix
3. The Projection Matrix
4. The Windows Screen Coordinates
5. Variables Where The Output OpenGL Coords Will Be Stored

So how do you get them?

ANOTHER WAY TO HANDLE INPUT

AKA Pointers Are Your Friends

Before we begin, to read this article you must know:

  • What a Windows Message is and how it can be handled
  • What a Function Pointer is

In this article I'm going to explain another way to handle input apart from the traditional keys[ ] array. I used to mess up the code with the keys[ ] because I always add new keys or even keyboard modes when I'm coding. One incorrect brace can drive the compiler mad. So, my aim is to make a system where you can just register a key and its function. It will support several keyboard modes (menu mode, game mode, limbo mode,…..). I will also add a function for text editing and a function to scan what number a key has.

QUICK GUIDE TO RUNNING JOGL CODE

In Order To Run JoGL Code You Need To:

1- Download Java Runtime 1.4+ found at http://java.sun.com/j2se/1.4.2/download.html.

2- Download the Binaries from https://games-binaries.dev.java.net/build/index.html.

3- Extract the Binaries to /..Program Files/Java/JREXX/Lib/Ext (you might have two runtimes, so extract the binaries to both to make sure everything runs ok).