Camera zoom?

Started by dangerdoc, April 05, 2012, 01:14:26

Previous topic - Next topic

dangerdoc

How do you zoom the camera in?
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

Longarmx

Are you talking about 3D or 2D? Could you provide us with a little more information? ???

dangerdoc

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.
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

CodeBunny

Highly dependent on your rendering system.

How do you manage the camera?

Fool Running

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.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

dangerdoc

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 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. Thanks for your replies!
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

Fool Running

Quote from: dangerdoc on April 13, 2012, 13:29:07
Now, I don't know about frustrum, but I found this 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.
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

dangerdoc

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!
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

dangerdoc

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?
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla

matheus23

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 :)
My github account and currently active project: https://github.com/matheus23/UniverseEngine

dangerdoc

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!!!  :)
“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla