<p>3D object surface is 2D domain and can thus be parametrized with a 2D function. In case of a unit cube you could parametrize the surface for example by mapping each 6 faces to a 2D image strip. So if you know two points of the ray that intersects the cube, you can define it with 4D function using the parametrization</p>

CC BY-SA 3.0
2017-01-14T16:10:34.077Z
2017-01-14T16:10:34.077Z
JarkkoL
<p>In the paper <a href="http://www3.cs.stonybrook.edu/~mueller/papers/EG06_geomfield.pdf" rel="nofollow noreferrer">Real-time Reflection using Ray Tracing with Geometry Field
</a>, it mentions this:</p>

<blockquote>
  <p>A ray is represented
  by its two intersection points (in,out) with the bounding box
  of the surface. Hence, the geometry field is a 4 dimensional
  function.</p>
</blockquote>

<p>Having two $3D$ points gives 6 values: $A=(A_x,A_y,A_z), B = (B_x, B_y, B_z)$.</p>

<p>How is it that those 6 values, which are on the surface of a unit cube, can be represented with only 4 numbers?</p>

<p>Edit: the best I can think of is to convert each point to spherical coordinates and throw away the length, effectively converting these points to points on a unit sphere.  That way involves some trig operations though. Is there a better way that uses less computation?</p>

CC BY-SA 3.0
2017-01-14T02:57:15.713Z
UV-mapping the surface?
Nathan Reed
CC BY-SA 3.0
2017-01-14T03:13:50.313Z
Hrm yeah I guess that's true if you have   a unique range of u and v per face!
Alan Wolfe
CC BY-SA 3.0
2017-01-14T11:00:48.843Z
2 time 2 angle pairs? See the third rotation about the own axis is not needed to represent a arrow in any direction.
joojaa
CC BY-SA 3.0
2017-01-14T14:30:11.073Z
That's what I was thinking too with the spherical coordinates. You don't need roll! But getting the angles takes some trig.  However, this lets you do a ray intersection against a generic object as a table lookup so maybe the trig ops aren't a bad trade off.  Nathan Reed's idea doesn't have that though which is interesting.
Alan Wolfe
<mathematics>
Enter/Exit of unit cube representable as 4 numbers?
Alan Wolfe
# Enter/Exit of unit cube representable as 4 numbers?

(Asked by: username_0 on 2017-01-14)

In the paper [Real-time Reflection using Ray Tracing with Geometry Field](http://www3.cs.stonybrook.edu/~mueller/papers/EG06_geomfield.pdf), it mentions this:

> A ray is represented
> by its two intersection points (in,out) with the bounding box
> of the surface. Hence, the geometry field is a 4 dimensional
> function.

Having two $3D$ points gives 6 values: $A=(A\_x,A\_y,A\_z), B = (B\_x, B\_y, B\_z)$.

How is it that those 6 values, which are on the surface of a unit cube, can be represented with only 4 numbers?

Edit: the best I can think of is to convert each point to spherical coordinates and throw away the length, effectively converting these points to points on a unit sphere. That way involves some trig operations though. Is there a better way that uses less computation?

**Tags:** mathematics

> **Comments:**
> **username_1**: UV-mapping the surface?  
> **username_0**: Hrm yeah I guess that's true if you have   a unique range of u and v per face!  
> **username_2**: 2 time 2 angle pairs? See the third rotation about the own axis is not needed to represent a arrow in any direction.  
> **username_0**: That's what I was thinking too with the spherical coordinates. You don't need roll! But getting the angles takes some trig.  However, this lets you do a ray intersection against a generic object as a table lookup so maybe the trig ops aren't a bad trade off.  username_1 username_1's idea doesn't have that though which is interesting.  

---

## 1 answers

### Answer by username_3 on 2017-01-14. Score: 4 | Accepted answer

3D object surface is 2D domain and can thus be parametrized with a 2D function. In case of a unit cube you could parametrize the surface for example by mapping each 6 faces to a 2D image strip. So if you know two points of the ray that intersects the cube, you can define it with 4D function using the parametrization


---

