LWJGL Forum

Programming => General Java Game Development => Topic started by: dangerdoc on April 05, 2012, 01:14:26

Title: Camera zoom?
Post by: dangerdoc on April 05, 2012, 01:14:26
How do you zoom the camera in?
Title: Re: Camera zoom?
Post by: Longarmx on April 05, 2012, 17:35:02
Are you talking about 3D or 2D? Could you provide us with a little more information? ???
Title: Re: Camera zoom?
Post by: dangerdoc on April 05, 2012, 18:02:30
I am sorry, I forgot that there is even a 2-D when I posted.... I meant 3-d. I just want to zoom a 3-d camera in. Thanks, and sorry for not giving more info.
Title: Re: Camera zoom?
Post by: CodeBunny on April 05, 2012, 18:35:29
Highly dependent on your rendering system.

How do you manage the camera?
Title: Re: Camera zoom?
Post by: Fool Running on April 11, 2012, 12:35:45
There are multiple ways you could do this. You could actually move the camera forward to "look" like it's zooming in. However, I assume you want a more realistic way. I think you could accomplish this by changing your frustrum to be smaller on the far-z axis (i.e. shaped more like a 2D frustrum). That would counter-act the usual further-objects-get-smaller effect to make it zoom in.
Title: Re: Camera zoom?
Post by: dangerdoc on April 13, 2012, 13:29:07
Hello,
Thank you for replying, I have learned a lot on this forum thanks to the friendly replies! Now, I don't know about frustrum, but I found this (http://www.lighthouse3d.com/tutorials/view-frustum-culling/) on google. So, your saying to change the farplane so that it is basically thicker? I do not know much about frustrum. If I was right about changing the farplane in my understanding, then how do you change the z-axis? In reply to codebunny, I don't quite know yet, but I think that I will be using this (http://www.lloydgoodall.com/tutorials/first-person-camera-control-with-lwjgl/). Thanks for your replies!
Title: Re: Camera zoom?
Post by: Fool Running on April 16, 2012, 12:51:23
Quote from: dangerdoc on April 13, 2012, 13:29:07
Now, I don't know about frustrum, but I found this (http://www.lighthouse3d.com/tutorials/view-frustum-culling/) on google. So, your saying to change the farplane so that it is basically thicker? I do not know much about frustrum. If I was right about changing the farplane in my understanding, then how do you change the z-axis?
Sorry, I meant change the further away frustrum plane (i.e. the far plane in the image) so that it is smaller. If you are using GLU.gluPerspective(), I think you can just change the fovy (field of view) parameter to make it smaller.
Title: Re: Camera zoom?
Post by: dangerdoc on April 17, 2012, 21:54:58
Thank you for your help. I have learned what I wanted, and will be experimenting on it!!! I went to google, found which parameters for glu.gluperspective were which and that fixed it for me!!! Thank you also codebunny!
Title: Re: Camera zoom?
Post by: dangerdoc on June 19, 2012, 22:31:28
Does GLU.gluPerspective work with GL11 rendering? In my game I am using GL11 for the camera and the rendering. If it is not compatible, what is the GL11 way to zoom in 3-d?
Title: Re: Camera zoom?
Post by: matheus23 on June 20, 2012, 17:32:18
Quote from: dangerdoc on June 19, 2012, 22:31:28
Does GLU.gluPerspective work with GL11 rendering? In my game I am using GL11 for the camera and the rendering. If it is not compatible, what is the GL11 way to zoom in 3-d?
It is :)
Title: Re: Camera zoom?
Post by: dangerdoc on June 22, 2012, 15:09:49
Quote from: matheus23 on June 20, 2012, 17:32:18
Quote from: dangerdoc on June 19, 2012, 22:31:28
Does GLU.gluPerspective work with GL11 rendering? In my game I am using GL11 for the camera and the rendering. If it is not compatible, what is the GL11 way to zoom in 3-d?
It is :)
Thanks!!!  :)