Research Article

Ray Tracing Acceleration Algorithm Based on FaceMap

Algorithm 2

Screen space curve mapping algorithm.
Input: A curve information
(1) Plot function of space curve (Input the two vertices of the curve):
  (1) Project the two vertices onto the screen space as two endpoints
  (2) Add the first endpoint
  (3) if the distance between the two endpoints is longer than one pixel:
    (i) Find the midpoint of the two vertices
    (ii) Curve approximation function (the first vertex and the midpoint)
    (iii) Add the endpoint after the midpoint projection
    (iv) Curve approximation function (the midpoint and the second vertex)
  (4) else Add the second endpoint
(2) Curve approximation function (input the two 3D vertices):
  (1) if the distance between endpoints after vertex projection is longer than one pixel:
    (i) Find the midpoint of the two vertices
    (ii) Curve approximation function (the first vertex and the midpoint)
    (iii) Add the endpoint after the midpoint projection
    (iv) Curve approximation function (the midpoint and the second vertex)
  (2) else null
Output: Results after mapping