Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6329787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:44:32+00:00 2026-05-24T17:44:32+00:00

I’m trying to implement a simple ray-tracing algorithm so the first step is to

  • 0

I’m trying to implement a simple ray-tracing algorithm
so the first step is to convert pixel coordinates into uvw coordinates system
iam using those two equations that i found in a book
enter image description here

where l,r,b,t are the view frustum points , (i,j) are the pixel indexes , (nx,ny) are the scene width and height

then to calculate canonical coordinate i use

enter image description here

i want to understand the previous equations and why they give uwv coordinates for perspective projection not for orthogonal projection (when i use orthogonal projection the equation still gives the result as if perspective projection is used)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:44:33+00:00Added an answer on May 24, 2026 at 5:44 pm

    Let’s assume your camera is some sort of a pyramid. It has a bottom face which I’ll refer to as the “camera screen”, and the height of the pyramid, also known as the focal length, will be marked as F (or in your equations, Ws).

             T(op)
           *---------*
           |\       /|
           | \     / |
           |  \   /  |
           |   \ /   |
    L(eft) |    *E(ye| R(ight)
           |   / \   |
           |  /   \  |
           | /     \ |
           |/       \|
           *---------*
             B(ottom)
    

    Let’s assume j goes from the bottom to the top (from -Ny/2 to +Ny/2 in steps of 1/Ny), and i goes from left to right (from -Nx/2 to +Nx/2 in steps of 1/Nx). Note that if Ny is even, j goes up to Nx/2-1 (and similar when Nx is even).

    As you go from bottom to top in the image, on the screen, you move from the B value to the T value. At the fraction d (between 0=bottom and 1=top) of your way from bottom to top, your height is

    Vs = T + (B-T) * d
    

    A bit of messing around shows that the fraction d is actually:

    d = (j + 0.5) / Ny
    

    So:

    Vs = T + (B-T) * (j + 0.5) / Ny
    

    And similarly:

    Us = L + (R-L) * (i + 0.5) / Nx
    

    Now, let’s denote U as the vector going from left to right, V from bottom to top, ‘W’ going from the eye forward. All these vectors are normalized.

    Now, assume the eye is located directly above (0,0) where that is exactly above the center of the rectangular face of the pyramid.

    To go from the eye directly to (0,0) you would go:

    Ws * W
    

    And then to go from that point to another point on the screen at indexes (i,j) you would go:

    Us * U + Vs * V
    

    You will be able to see that Us = 0 for i = 0 and Vs = 0 for j = 0 (since B = -T and L = -R, as the eye is directly above the center of the rectangle).

    And finally, if we compose it together, a point on the screen at indexes (i,j) is

    S = E + Us * U + Vs * V + Ws * W
    

    Enjoy!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.