PDA

View Full Version : Variable meaning in OpenGL demo



candy
10-30-2002, 08:40 AM
I have downloaded the Atlantis demo for investigate from the page below:
http://www.opengl.org/developers/code/glut_examples/demos/demos.html

However, I got some problems on it. I don't know the meaning of the variables in the program since it doesn't has much comments.

I have guessed some meaning of the variables in the program, please correct me if I am wrong and tell me the meaning that I miss.

typedef struct _fishRec {
float x, y, z; <-- position of the fish
float phi; <-- don't know
float theta; <-- pitch angle
float psi; <-- yaw angle
float v; <-- speed of the fish
float xt, yt, zt; <-- don't know
float htail, vtail; <-- don't know
float dtheta; <-- don't know
int spurt, attack; <-- frag for action
} fishRec;

Is there any information about this example or can some body give me some ideas about those variables. Thanks you.

coredump
10-30-2002, 08:44 AM
hmmm...maybe ask the author. phi may be rotation about Z axis (roll). xt, yt, zt may be position after a certain time. dtheta may be the timne since the last update (used to calculate xt, yt, zt). htail, vtail - no idea.

b

nexusone
10-30-2002, 05:15 PM
Also compile the program and watch the fish... will give you an idea of the movement.
Also look at the data that is supplied to the structure.

h/vtail maybe tail fin movement....



Originally posted by Candy:
I have downloaded the Atlantis demo for investigate from the page below:
http://www.opengl.org/developers/code/glut_examples/demos/demos.html

However, I got some problems on it. I don't know the meaning of the variables in the program since it doesn't has much comments.

I have guessed some meaning of the variables in the program, please correct me if I am wrong and tell me the meaning that I miss.

typedef struct _fishRec {
float x, y, z; <-- position of the fish
float phi; <-- don't know
float theta; <-- pitch angle
float psi; <-- yaw angle
float v; <-- speed of the fish
float xt, yt, zt; <-- don't know
float htail, vtail; <-- don't know
float dtheta; <-- don't know
int spurt, attack; <-- frag for action
} fishRec;

Is there any information about this example or can some body give me some ideas about those variables. Thanks you.

candy
10-30-2002, 05:41 PM
Thanks all of you. http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by nexusone:
Also compile the program and watch the fish... will give you an idea of the movement.
Also look at the data that is supplied to the structure.

h/vtail maybe tail fin movement....




I tried to compile the program in VC++, but it was not success. Is that the source code can be compiled in sgi only?

I also can't run the demo executable file, it beeps me that I need glut.dll, glu.dll, and opengl.dll.....Is that the exe file can't run in windows environment?

candy
10-30-2002, 06:16 PM
When I compile in VC++, I got the following error message. Is that something I go wrong? Please teach me, thanks you.

--------------------Configuration: test2 - Win32 Debug--------------------
Compiling...
Atlantis.c
Dolphin.c
Shark.c
Swim.c
Whale.c
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/test2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

DaMangz
10-30-2002, 06:18 PM
Is it a GLUT demo? You are trying to compile a windows program but you have not declared WinMain in the program. The code compiles fine it's how you've set up the project that's wrong.

If it uses glut than it has a main() function, so compile your project to be a Windows console application instead, and make sure to link in the glut libraries.

Hope that helps.

candy
10-30-2002, 09:54 PM
Thx DaMangz, I am now able to run the program. http://www.opengl.org/discussion_boards/ubb/smile.gif