Jump to content

  • Log In with Google      Sign In   
  • Create Account


Rotti

Member Since 06 Sep 2011
Offline Last Active Sep 19 2011 12:17 AM

Topics I've Started

Different speeds on different pc's all using Windows

12 September 2011 - 02:45 PM

Hi

I made a program that has some moving objects, It seemed that they were moving a bit slow in the beginning since their moving vectors where quite big in relation to their positions, but I thought it was some openGL limiter or something. When I started mailing my friends(windows users) the link to the zipped file (which contains the .exe and the glut32.dll and a readme.txt) some of them said the it looks cool, and others said that the balls where spinning VERY fast.

I then thought it can't be because there pc's are that much faster, it had to be some setting. I've been reading about "vsync" and the "wgl" functions that can be used to set vsync, but some guys on these forums say that you should not change "vsync" unless you really need to. I this a good enough reason? to have my program run at the same speed on all windows computers, is very important to me, and I don't want to ask everbody to go change some setting in the control panel or graphics card options. I want to tell the program exactly how to look and how fast the objects must move in the code in a legit way.

If I do understand vsync and it is not to taboo to set it to "0", I would like to turn it of, so that the program draws as fast as it possibly can, and I can decrease my movement vectors, for even smaller position changes more often. Is this the right way of reasoning?

Here is the link I was forwarding to my friends:
http://www.userotti....ngl/planets.zip

The program code is very basic, maths, vectors, matrix stuff, trig. It uses double buffering, and glSwapbuffers at the end of my display function. I also use the following functions:
glutGameModeString( "1280×1024:32@75" );
glutEnterGameMode();

Please. Go easy on me.

Thanks.

Objects and Cameras in a 3D world, OpenGL

06 September 2011 - 01:58 PM

Hi

I'm working with C++. I think I'm slowly but surely understanding the the modelview matrix and how changing it, changes what you see.
I've read a lot about guys talking about there is no camera and all that jazz, It starting to make sence, but its stil a trip. I've read about and looked at the glLookat function,
some guy gave the source code for it somewhere, and I understand what happens there. The parameters are all in terms of the Object frame. I'm planning on using it, so bare with me.

Now, I'm imagining a scene, a 3d world with objects(say cubes) and a camera, I realize that the modelview matrix needs to be set by the glLookat function for each object in the world, depending on where the object is in relation to the camera. Each object is designed in its own frame and has its origin at the middle of the object. So we have the object frames, which are the floating cubes, we have the scene frame(which openGL knows nothing of?), which is the frame that says where all the objects and the camera is, then we have the camera frame.

If I'm on the right track my question should be:

How do I use the info(x,y,z co-ordinates, rotations ,lookat vector) of the objects and the camera in the scene frame, to compute the parameters I need to pass to the glLookat function for each object just before you draw it?

Please point me in the right vector direction. :P

Objects and Cameras in a 3D world, OpenGL

06 September 2011 - 12:16 PM

Hi

I've been working with OpenGL and C++. I think I'm slowly but surely understanding the the modelview matrix and how changing it, changes what you see.
I've read a lot about guys talking about there is no camera and all that jazz, It starting to make sence, but its stil a trip. I've read about and looked at the glLookat function,
some guy gave the source code for it somewhere, and I understand what happens there. The parameters are all in terms of the Object frame. I'm planning on using it, so bare with me.

Now, I'm imagining a scene, a 3d world with objects(say cubes) and a camera, I realize that the modelview matrix needs to be set by the glLookat function for each object in the world, depending on where the object is in relation to the camera. Each object is designed in its own frame and has its origin at the middle of the object. So we have the object frames, which are the floating cubes, we have the scene frame(which openGL knows nothing of?), which is the frame that says where all the objects and the camera is, then we have the camera frame.

If I'm on the right track my question should be:

How do I use the info(x,y,z co-ordinates, rotations ,lookat vector) of the objects and the camera in the scene frame, to compute the parameters I need to pass to the glLookat function for each object just before you draw it?

Please point me in the right vector direction. :P

PARTNERS