Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualOlof Hedman

Posted 14 May 2013 - 06:24 AM

For all 3d graphics, the "camera" is just a useful abstraction for how to construct the view and projection transform matrix.

 

If it "moves" or not, is up to you as a programmer to decide, depending on how you want to look at it.

 

It's equally valid to see it as the camera moves around, as it is to see it as the world is rotated and moved around the camera.

The math will be the same.

 

I'd recommend you chose whatever you feel is intuitive, that usually results in better structured code.

 

A very common way is to construct the view matrix from an eye-position, a lookat-point, and an up-vector.

The "camera" would just be these values stored somewhere (maybe in a class called Camera)

 

Here is the code for gluLookAt, which implement this: http://www.opengl.org/wiki/GluLookAt_code


#3Olof Hedman

Posted 14 May 2013 - 06:23 AM

For all 3d graphics, the "camera" is just a useful abstraction for how to construct the view and projection transform matrix.

 

If it "moves" or not, is up to you as a programmer to decide, depending on how you want to look at it.

 

It's equally valid to see it as the camera moves around, as it is to see it as the world is rotated and moved around the camera.

The math will be the same.

 

I'd recommend you chose whatever you feel is intuitive, that usually results in better structured code.

 

A very common way is to construct the view matrix from an eye-position, a lookat-point, and an up-vector.

The "camera" would just be these values stored somewhere (maybe in a class called Camera)

 

Here is the code for gluLookAt, which implemnt this: http://www.opengl.org/wiki/GluLookAt_code


#2Olof Hedman

Posted 14 May 2013 - 06:09 AM

For all 3d graphics, the "camera" is just a useful abstraction for how to construct the view and projection transform matrix.

 

If it "moves" or not, is up to you as a programmer to decide, depending on how you want to look at it.

 

It's equally valid to see it as the camera moves around, as it is to see it as the world is rotated and moved around the camera.

The math will be the same.

 

I'd recommend you chose whatever you feel is intuitive, that usually results in better structured code.


#1Olof Hedman

Posted 14 May 2013 - 06:08 AM

For all 3d graphics, the "camera" is just a useful abstraction for how to construct the view and projection transform matrix.

 

If it "moves" or not, is up to you as a programmer to decide, depending on how you want to look at it.

 

It's equally valid to see it as the camera moves around, as it is to see it as the world is rotated and moved around the camera.

The math will be the same.


PARTNERS