rotti

Member
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About rotti

  • Rank
    Newbie
  1. 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: [url="http://www.userotti.com/opengl/planets.zip"]http://www.userotti....ngl/planets.zip[/url] 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.
  2. Thanks guys Please take a look at what I made over the weekend: I'm stil using gluLookAt, but I'm doing quite a lot of trig, evertime the mouse moves, is this very expensive? this very basic app, doesn't seem to have any problems with it at the moment. http://www.userotti.com/opengl/planets.zip I'm using the "glut32.dll" so I think its windows only...
  3. Hi Thanks everyone, I enjoyed your comments. @latent thanks for that bit of code, I made this just to test the waters: glLoadIdentity(); gluLookAt(10,20,20, 0,0,0, 0,1,0); int i,j,k; for (i =0; i<10 ; i++) { for (j =0; j<10 ; j++) { for (k =0; k<10 ; k++) { glPushMatrix(); glTranslatef(-i, -j, -k); glScalef(0.3,0.3,0.3); tetrahedron(n); glPopMatrix(); } } } It draws the tetrahedrons, 10 by 10 by 10, and the gluLookAt makes the camera sit at a nice birds I eye point of view at (10,20,20) to view the big cube of objects. This is great, makes a lot of sence the setting of the models and the the setting of the view. @Trienco It seems that this is one of those times the (0,1,0) vector does work. I do understand that this is not write though, it should be like the pencil. So how do I go about calculating it before I set the view matrix by gluLookAt(); ? I've got the lookat vector... ok, something happend to that vetcor to change it from (0,0,-1) down the negative z axes to the bird's eye vector (-10,-20,-20) ? and that same thing needs to happen to the pencil vector while its stil pointing at (0,1,0)? Do you think this problem can be avoided by not using the gluLookAt and by making the view matrix myself? If so? Making and implementing a small math library sounds tough. Were do I start? I want to fly around in this world!
  4. 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
  5. 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.