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
-----

Posts I've Made

In Topic: Objects and Cameras in a 3D world, OpenGL

12 September 2011 - 02:57 AM

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...

In Topic: Objects and Cameras in a 3D world, OpenGL

07 September 2011 - 03:53 PM

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!

PARTNERS