# Focal Point Question, Computer Graphic

This topic is 462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

the self-taught thread profess you guys to be genius programmers at age 12 or something. so u figure you guys must know the answer the question i am stuck on.

i'm programming a perspective game engine from scratch without open GL functions, and read up on how to 3d perspective work.

I get the basic gist of it. one issue so far.

how is focal point determined.  wat value is used here.  let's say if i were to create a camera for a game.

Edited by max zeng

##### Share on other sites

What focal point? There is nothing of the sort in the posted diagram.

Seriously, all you need to render a 3D scene is either finding Xim (and whether it's clipped) given Xcam or more likely Xcam given Xim. Xim coordinates also need to be transformed between 3D and 2D. The only parameters are the locations of C and P (where is your camera and where is it facing) and the U and V directions (tilt and rotation of the image plane, often but not necessarily constrained to be perpendicular to Z).

##### Share on other sites

focal length, wat value is used for this

##### Share on other sites

You don't need focal length for a regular 3D projection.

##### Share on other sites
1 hour ago, max zeng said:

focal length, wat value is used for this

It's not clear what you're asking.  As far as I can tell from your drawing, the "focal length" is just the distance along the line of sight to the point P, which is the "image center".  But, what is the image?  What is the image plane you're talking about?  In a game camera you have a zNear (near clipping plane) and zFar (far clipping plane) and everything in between are just points.  There is no focal distance unless you're talking about some depth-of-field rendering.  In a normal game camera, everything is in focus.

##### Share on other sites

wat is the value is for BZ, camera to image plane.

##### Share on other sites

The focal distance BZ is the distance between a point (the camera location) and a plane (the image plane). Both are under your control, so the computation is straightforward. There are very simple formulas.

Of course, as Hodgman noted, BZ doesn't have any useful role to play. Can you explain why you care about this distance?

Edited by LorenzoGatti

##### Share on other sites

look at FIgure 2:

see where all the rays converge onto a single point, that's what the eye represent on the last picture i posted.

the focal length is the distance this point of convergence to the image plane.

the focal length matters because you need it to calculate the point of intersection between the object you are looking at to the image plane to get a 2d rasterization.

1. 1
2. 2
Rutin
19
3. 3
khawk
15
4. 4
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633744
• Total Posts
3013652
×