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

  • SEARCH
  • Home
  • 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 8517137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:37:07+00:00 2026-06-11T05:37:07+00:00

I am trying to implement the algorithm explained on this paper, used to traverse

  • 0

I am trying to implement the algorithm explained on this paper, used to traverse grid cells in order following a straight line, which is useful for ray tracing:

http://www.cse.yorku.ca/~amana/research/grid.pdf

The paper describes the algorithm as two parts: initialisation and iterative traversal. I can undersand the iterative traversal part, but I’m having trouble understanding how some of the variables in the initialisation part are calculated.

I need help initialising tMaxX, tMaxY, tDeltaX & tDeltaY. Their initialisation procedure is explained as follows:

Next, we determine the value of t at which the ray crosses the first
vertical voxel boundary and store it in variable tMaxX. We perform a
similar computation in y and store the result in tMaxY. The minimum of
these two values will indicate how much we can travel along the ray
and still remain in the current voxel.

Finally, we compute tDeltaX and tDeltaY. TDeltaX indicates how far
along the ray we must move (in units of t) for the horizontal
component of such a movement to equal the width of a voxel. Similarly,
store in tDeltaY the amount of movement along the ray which has a
vertical component equal to the height of a voxel.

I’m not able to deduce the code I need form the English description given above. Can someone translate it to a math/pseudocode expression for me?

  • 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-06-11T05:37:08+00:00Added an answer on June 11, 2026 at 5:37 am

    Initialization for X-coordinate variables (the same for Y)

      DX = X2 - X1
      tDeltaX = GridCellWidth / DX
      tMaxX = tDeltaX * (1.0 - Frac(X1 / GridCellWidth)) 
      //Frac if fractional part of float, for example, Frac(1.3) = 0.3, Frac(-1.7)=0.3
    

    Example:

      GridCellWidth, Height = 20
      X1 = 5, X2 = 105 
      Y1 = 5, Y2 = 55 
      DX = 100, DY  = 50
      tDeltaX = 0.2, tDeltaY = 0.4 
      tMaxX = 0.2 * (1.0 - 0.25) = 0.15  //ray will meet first vertical line at this param
      tMaxY = 0.4 * (1.0 - 0.25) = 0.3   //ray will meet first horizontal line at this param
    

    We can see that first cell border will be met at parameter t = 0.15

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

Sidebar

Related Questions

Well am referring the following paper and trying to implement the algorithm as given
I am trying to implement an algorithm described in this paper: Decomposition of biospeckle
I'm trying to implement this algorithm description from a previous question I had here
I am trying to implement a vision algorithm, which includes a prefiltering stage with
I am trying to implement Quick Sort algorithm. Following code works for unique elements
I trying to implement synchronization algorithm in C#, without success. Why isn't the following
i'm trying to implement an algorithm which is flood-fill alike. the problem is that
I have this weird kind of error. I am trying implement basic Euclidean algorithm
I am trying to implement the following algorithm using the divide and conquer method
I'm trying to implement this algorithm: http://www.cs.cmu.edu/afs/cs/academic/class/15451-s06/www/lectures/scrabble.pdf but I just cannot figure out what

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.