Results 1 to 2 of 2

Thread: How to simulating focal length in OpenGL ?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2014
    Posts
    15

    How to simulating focal length in OpenGL ?

    Dear All:
    My application need me to simulate a virtual camera in OpenGL.
    How to simulate or compute the focal length based on glulookat and gluperspective?
    In computer vision, if a 3d point locate at (X,Y,Z) (in camera coordinate system),
    then this point should be project to the image pixel (u,v)=(f*X/Z,f*Y/Z).
    How to simulate this? I mean if the camera position ,direction and focal f are given, how to calculate the fovy and znear?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,649
    Websearch "depth of field" techniques. Possibly in combination with "OpenGL". Also search "bokeh" possibly in combination with "pettineo". Lots of good stuff out there. The basic concept is that you have a depth that is perfectly in-focus but as you get further from the plane, you get more and more out-of-focus. Blur is often used to simulate the out-of-focus effect.

Similar Threads

  1. Replies: 1
    Last Post: 09-04-2014, 10:54 AM
  2. Camera focal length
    By glnoob_andre in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-10-2012, 02:24 PM
  3. What is focal length in OpenGL?
    By Duncan Champney in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 10-04-2008, 07:29 AM
  4. How to set focal length in OpenGL^_^
    By hawaii in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 04-05-2007, 06:19 AM
  5. Cameras: Focal Length
    By Sebastian Jancke in forum COLLADA
    Replies: 4
    Last Post: 07-29-2006, 08:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean