Analytical Method for Reflection and Refraction

Nobuhiko Mukai

## Abstract

In computer graphics, ray tracing is very simple and powerful method to present physical phenomena especially light-related things such as reflection and refraction since it traces the ray from the eye to the light source; however, we cannot understand how the result image is generated. Then, this chapter describes the mechanism of reflection and refraction. It is very time-consuming to render the target object considering reflection and refraction. If the object distorted by reflection and refraction is previously obtained, it is very fast to generate the result image since all we have to do is to render the distorted object without considering reflection and refraction. In the proposed method, firstly, a virtual object, which is constructed with vertices translated from original ones by considering reflection and refraction, is generated. Then, the image with reflection and refraction is generated by rendering the virtual object. In the analysis, total reflection and attenuation of light power are also considered. At last, the proposed method is applied to two types of transparent objects: cubed glass and cylindrical glass, and the comparison between the simulation results and the real photos is performed to demonstrate that the generated images are the same as the real ones.

Keywords: reflection, refraction, virtual object, total refection, ray tracing, cubed glass, cylindrical glass

## 1. Introduction

Computer graphics is a very powerful tool to visualize natural phenomena such as thunder with lighting, avalanche in blizzard, reflection on a glass window, and so on. Among them, one of the most challenging issues is to visualize optical-related phenomena such as reflection and refraction. Although ray tracing is the most powerful method, it takes huge amount of time to trace the ray that has emitted from a light source and reaches the eye through each pixel of an image. The method searches the trace by dividing it to two phenomena: reflection and refraction. It generates the image with a recursive process so that the image can be generated with a simple algorithm. However, the image generated on a glass by reflection and refraction is so complicated that we cannot understand which part of the image is generated by reflection and/or refraction.

Then, this chapter describes an analytical method that draws an image generated on a geometrically defined object such as parallel glass, cubed glass, or cylindrical glass by reflection and/or refraction. The method analyzes the trace of the ray in a transparent object and generates a virtual object, which is constructed with vertices

#### Computer Graphics and Imaging

translated from original ones by considering reflection and refraction. In addition, the mechanism of total reflection and the attenuation of light power are also investigated. Thereafter, each image with reflection and/or refraction is generated by rendering the virtual object without considering reflection and refraction. Then, the final image is generated by combining every image drawn separately with the virtual objects.

cause of refraction is already known [17]. If we use this method, we can estimate the

This section describes how to generate a virtual object, which has vertices translated from original ones by considering reflection. Figure 1 illustrates the

Generating realistic images with reflection and refraction requires huge amount of time so that most of research use texture mapping with the help of GPU power. Although these techniques produce realistic images with reflection and refraction very fast, we do not understand which part of the image is generated by reflection and/or refraction. On the contrary, the virtual object that Ofek et al. [9] proposed has vertices translated from the original ones by considering reflection. Then, if we can understand how the original object is transformed by reflection and refraction, the image can be generated very fast. Therefore, Mukai et al. investigated how the vertices of an object are translated from the original ones by refraction in a cylindrical glass [18] and also represented the complex image on a cubed glass by combining each image that has simple reflection and/or refraction [19]. Therefore, this chapter describes how an object is transformed by reflection and refraction and how the vertices constructing the object are translated from the original positions. First, the analysis of reflection and refraction is described, and a virtual object, which is transformed from the original one by reflection and refraction, is generated. Then, the image with reflection and refraction is generated by combining each image rendered with the virtual object. At last, the proposed method is used for two types of applications: the image with reflection and refraction generated on a cubed glass and the image with refraction generated on a cylindrical glass. In addition, the result shows that the simulation images are the same as the real ones by comparison

original shape of objects deformed by refraction.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

between the generated images and the real photos.

3. Virtual object

3.1 Reflection

Figure 1.

27

Virtual vertex due to reflection on a parallel glass.

Moreover, two types of applications with the proposed method are presented. One is to generate the image with reflection and refraction on a cubed glass, where there are six facets that have different number of reflection and refraction, and also total reflection happens on some facets depending on the eye position. The other is to represent a refractive image on a cylindrical glass, where four refractions happen when the light passes in the interior of the cylindrical glass.

At last, in order to demonstrate that the images generated with the proposed method are realistic, the simulation images are compared with real photos. One is the image that has reflection and refraction on a cubed glass, and the other is one that has refraction on a cylindrical glass.

## 2. Related works

In generation of realistic images with computer graphics, Whitted invented ray tracing [1, 2], which is the most simple and powerful method; however, it requires a lot of time to trace the ray for every pixel of the image. Then, Heckbert et al. proposed beam tracing [3] and Amanatides suggested cone tracing [4]. These methods are faster than ray tracing because they trace the ray not for each pixel but for the bundle of it by utilizing spatial coherence. On the other hand, Blinn et al. had invented texture mapping [5] to generate realistic images with a simple and fast method. Then, Pauline et al. used texture mapping to represent waves [6], and Hakura et al. proposed parameterized environment mapping [7], which is an extended method of texture mapping and reproduces local reflection from prerendered viewpoints. Texture mapping can create realistic images in real time since some pre-generated texture images are used in the rendering; however, multiple images must be prepared especially when the viewpoint changes. Then, G'enevaux et al. suggested another method to obtain realistic and interactive effect of refraction [8].

On the other hand, Ofek et al. had proposed a method to generate reflective images by using virtual objects that are previously transformed from the original ones [9]. Conversely, Iwasaki et al. used texture mapping to render caustics on water surfaces [10]. Wang et al. also utilized environment mapping and interpolated the map in real time by using depth buffer [11].

Nowadays, graphics processing unit (GPU) is utilized for general purpose calculation that is used to be performed by central processing unit (CPU). Then, Wyman used GPU and performed an interactive image-space approach to represent refractive images on transparent objects [12]. Hu et al. also utilized GPU power and proposed an interactive computing scheme for rendering of reflection, refraction, and caustics [13]. In addition, Oliveira et al. utilized programmable GPU for imagespace technique that calculates the intersection between the ray and objects efficiently [14]. Furthermore, Rodgman et al. proposed another rendering method for refraction in volume graphics [15], and Rousiers et al. also proposed another method for representing refraction through a transparent object that has rough surfaces [16]. On the contrary, Chen et al. suggested a depth acquisition method from refractive images, which method can measure the depth from the eye if the

### Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

translated from original ones by considering reflection and refraction. In addition, the mechanism of total reflection and the attenuation of light power are also investigated. Thereafter, each image with reflection and/or refraction is generated by rendering the virtual object without considering reflection and refraction. Then, the final image is generated by combining every image drawn separately with the

Moreover, two types of applications with the proposed method are presented. One is to generate the image with reflection and refraction on a cubed glass, where there are six facets that have different number of reflection and refraction, and also total reflection happens on some facets depending on the eye position. The other is to represent a refractive image on a cylindrical glass, where four refractions happen

At last, in order to demonstrate that the images generated with the proposed method are realistic, the simulation images are compared with real photos. One is the image that has reflection and refraction on a cubed glass, and the other is one

In generation of realistic images with computer graphics, Whitted invented ray tracing [1, 2], which is the most simple and powerful method; however, it requires a lot of time to trace the ray for every pixel of the image. Then, Heckbert et al. proposed beam tracing [3] and Amanatides suggested cone tracing [4]. These methods are faster than ray tracing because they trace the ray not for each pixel but for the bundle of it by utilizing spatial coherence. On the other hand, Blinn et al. had invented texture mapping [5] to generate realistic images with a simple and fast method. Then, Pauline et al. used texture mapping to represent waves [6], and Hakura et al. proposed parameterized environment mapping [7], which is an extended method of texture mapping and reproduces local reflection from prerendered viewpoints. Texture mapping can create realistic images in real time since some pre-generated texture images are used in the rendering; however, multiple images must be prepared especially when the viewpoint changes. Then, G'enevaux

et al. suggested another method to obtain realistic and interactive effect of

lated the map in real time by using depth buffer [11].

On the other hand, Ofek et al. had proposed a method to generate reflective images by using virtual objects that are previously transformed from the original ones [9]. Conversely, Iwasaki et al. used texture mapping to render caustics on water surfaces [10]. Wang et al. also utilized environment mapping and interpo-

Nowadays, graphics processing unit (GPU) is utilized for general purpose calculation that is used to be performed by central processing unit (CPU). Then, Wyman used GPU and performed an interactive image-space approach to represent refractive images on transparent objects [12]. Hu et al. also utilized GPU power and proposed an interactive computing scheme for rendering of reflection, refraction, and caustics [13]. In addition, Oliveira et al. utilized programmable GPU for imagespace technique that calculates the intersection between the ray and objects efficiently [14]. Furthermore, Rodgman et al. proposed another rendering method for refraction in volume graphics [15], and Rousiers et al. also proposed another method for representing refraction through a transparent object that has rough surfaces [16]. On the contrary, Chen et al. suggested a depth acquisition method from refractive images, which method can measure the depth from the eye if the

when the light passes in the interior of the cylindrical glass.

that has refraction on a cylindrical glass.

virtual objects.

Computer Graphics and Imaging

2. Related works

refraction [8].

26

cause of refraction is already known [17]. If we use this method, we can estimate the original shape of objects deformed by refraction.

Generating realistic images with reflection and refraction requires huge amount of time so that most of research use texture mapping with the help of GPU power. Although these techniques produce realistic images with reflection and refraction very fast, we do not understand which part of the image is generated by reflection and/or refraction. On the contrary, the virtual object that Ofek et al. [9] proposed has vertices translated from the original ones by considering reflection. Then, if we can understand how the original object is transformed by reflection and refraction, the image can be generated very fast. Therefore, Mukai et al. investigated how the vertices of an object are translated from the original ones by refraction in a cylindrical glass [18] and also represented the complex image on a cubed glass by combining each image that has simple reflection and/or refraction [19]. Therefore, this chapter describes how an object is transformed by reflection and refraction and how the vertices constructing the object are translated from the original positions. First, the analysis of reflection and refraction is described, and a virtual object, which is transformed from the original one by reflection and refraction, is generated. Then, the image with reflection and refraction is generated by combining each image rendered with the virtual object. At last, the proposed method is used for two types of applications: the image with reflection and refraction generated on a cubed glass and the image with refraction generated on a cylindrical glass. In addition, the result shows that the simulation images are the same as the real ones by comparison between the generated images and the real photos.

## 3. Virtual object

#### 3.1 Reflection

Figure 1. Virtual vertex due to reflection on a parallel glass.

reflection on a parallel glass. In the figure, Eð Þ 0; 0 , θ, and M xm; ym are the eye position that is the origin of the Cartesian coordinate system, incident angle of light on the front plane of the parallel glass, and one vertex constructing the object shown in red, respectively. The dotted red line shows the trace of the ray that has emitted from a vertex M xm; ym and enters the eye position <sup>E</sup>ð Þ <sup>0</sup>; <sup>0</sup> . The front plane of the parallel glass is placed on y = p. If V xv; yv is obtained, we can generate the image by just rendering the virtual object including V xv; yv instead of the original one including M xm; ym . The virtual vertex V xv; yv translated from the original vertex M xm; ym is calculated as follows:

$$\mathbf{V}(\mathbf{x}\_{\nu}, \boldsymbol{y}\_{v}) = \mathbf{V}(\mathbf{x}\_{m}, \boldsymbol{y}\_{m} + 2T) = \mathbf{V}(\mathbf{x}\_{m}, \boldsymbol{y}\_{m} + 2p - \boldsymbol{y}\_{m}) \tag{1} \\ \vdots \\ \boldsymbol{y}\_{m} \le p \tag{1}$$

#### 3.2 Refraction

Figure 2 shows the refraction through a parallel glass, which has the thickness of H. In the figure, n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. The incidence angle of the ray that outputs from the eye is θ, and the refraction angle is ϕ. If V xv; yv is obtained, we can generate the image by just rendering the virtual object with V xv; yv instead of the original one with M xm; ym . Then, the virtual vertex V xv; yv is calculated as the following:

$$L\_{\mathcal{Y}} = \mathsf{Htan}(\phi) \tan \left\{ (\pi/2) - \theta \right\} \tag{2}$$

tan ð Þ¼ θ xm= ym � Ly

By substituting Eqs. (4) and (5) to Eq. (3), the following equation is obtained:

Finally, by solving Eq. (6) with an iterative method, the incidence angle θ is calculated. With the calculated incident angle θ, ϕ is also calculated with Eq. (5).

The above description is true for the case that the reflective or the refractive plane is parallel to X axis of the coordinate system. However, the rotation of the coordinate system is required for the case that the plane is inclined against X axis. Figure 3 shows the process of the vertex translation with the coordinate system rotation. In Figure 3(a), the plane is inclined against X axis by the angle ω. By the rotation, the plane becomes parallel to X axis, and the translation of the vertex A in Figure 3(b) is performed with the above process (the translated vertex is indicated as B in the figure). Then, the final vertex is obtained by the inverse rotation of the

Figure 4 shows the case where both reflection and refraction happen on a

on the front plane of the glass and also reflected on the back plane. Then, the ray reaches the eye after it is refracted again on the front plane. If we can calculate the temporary virtual vertex for the reflection on the back plane, we can consider this phenomenon, which has two refractions and one reflection, as another phenomenon that has two refractions and no reflection with another parallel glass which thickness is 2D instead of D. In the figure, this temporary vertex is shown as

. In addition, if we can calculate the virtual vertex, we can consider the

Vertex translation with the coordinate system rotation. (a) Rotation (b) Movement and (c) Inverse rotation.

thickness of the parallel glass. The ray that has emitted from M xm; ym

is a vertex that constructs an original object, and D is the

xm <sup>¼</sup> ym � <sup>H</sup> tan ð Þþ <sup>θ</sup> Htan sin �<sup>1</sup>

Then, the vertex of the virtual object is calculated as follows:

3.3 Inclination of a plane

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

coordinate system.

parallel glass. M xm; ym

M<sup>1</sup> xm; y<sup>1</sup>

Figure 3.

29

3.4 Combination of reflection and refraction

V xv; yv

(4)

½ � ð Þ <sup>n</sup>1=n<sup>2</sup> sin ð Þ<sup>θ</sup> (6)

is refracted

n<sup>1</sup> sin ð Þ¼ θ n<sup>2</sup> sin ð Þ ϕ (5)

<sup>¼</sup> <sup>V</sup> xm; ym � <sup>L</sup> (7)

$$\dots L\_{\mathcal{T}} = \mathcal{H}\{1 - \tan\left(\phi\right)\tan\left[\left(\pi/2\right) - \theta\right]\} = \mathcal{H}\{1 - \tan\left(\phi\right) / \tan\left(\theta\right)\}\tag{3}$$

However, θ is the incidence angle for the vertex M xm; ym constructing the original object, and the angle θ depends on the positions of E 0ð Þ ; 0 and M xm; ym . On the other hand, we can obtain the following equations from △ EOM in Figure 2 and Snell's law:

Figure 2. Virtual vertex due to refraction through a parallel glass.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

$$\tan\left(\theta\right) = \varkappa\_m / \left(\mathcal{Y}\_m - L\_\mathcal{Y}\right) \tag{4}$$

$$n\_1 \sin\left(\theta\right) = n\_2 \sin\left(\phi\right) \tag{5}$$

By substituting Eqs. (4) and (5) to Eq. (3), the following equation is obtained:

$$\mathcal{L}\mathbf{x}\_m = \left(y\_m - H\right)\tan\left(\theta\right) + \text{Htan}\left\{\sin^{-1}\left[\left(n\_1/n\_2\right)\sin\left(\theta\right)\right]\right\}\tag{6}$$

Finally, by solving Eq. (6) with an iterative method, the incidence angle θ is calculated. With the calculated incident angle θ, ϕ is also calculated with Eq. (5). Then, the vertex of the virtual object is calculated as follows:

$$\mathbf{V}(\mathbf{x}\_{\nu}, y\_{\nu}) = \mathbf{V}(\mathbf{x}\_{m}, y\_{m} - L) \tag{7}$$

#### 3.3 Inclination of a plane

reflection on a parallel glass. In the figure, Eð Þ 0; 0 , θ, and M xm; ym

from a vertex M xm; ym

Computer Graphics and Imaging

including M xm; ym

3.2 Refraction

M xm; ym

M xm; ym

and Snell's law:

Figure 2.

28

Virtual vertex due to refraction through a parallel glass.

parallel glass is placed on y = p. If V xv; yv

is calculated as follows:

V xv; yv

refraction angle is ϕ. If V xv; yv

rendering the virtual object with V xv; yv

. Then, the virtual vertex V xv; yv

by just rendering the virtual object including V xv; yv

. The virtual vertex V xv; yv

<sup>¼</sup> <sup>V</sup> xm; ym <sup>þ</sup> <sup>2</sup><sup>T</sup> <sup>¼</sup> <sup>V</sup> xm; ym <sup>þ</sup> <sup>2</sup><sup>p</sup> � ym

H. In the figure, n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. The incidence angle of the ray that outputs from the eye is θ, and the

However, θ is the incidence angle for the vertex M xm; ym

Figure 2 shows the refraction through a parallel glass, which has the thickness of

∴ Ly ¼ H 1f g � tan ð Þ ϕ tan ½ � ð Þ� π=2 θ ¼ H 1f g � tan ð Þ ϕ = tan ð Þθ (3)

original object, and the angle θ depends on the positions of E 0ð Þ ; 0 and M xm; ym

On the other hand, we can obtain the following equations from △ EOM in Figure 2

is obtained, we can generate the image by just

instead of the original one with

Ly ¼ Htanð Þ ϕ tan f g ð Þ� π=2 θ (2)

is calculated as the following:

position that is the origin of the Cartesian coordinate system, incident angle of light on the front plane of the parallel glass, and one vertex constructing the object shown in red, respectively. The dotted red line shows the trace of the ray that has emitted

and enters the eye position <sup>E</sup>ð Þ <sup>0</sup>; <sup>0</sup> . The front plane of the

is obtained, we can generate the image

instead of the original one

translated from the original vertex

<sup>∵</sup> ym <sup>≤</sup> <sup>p</sup> (1)

constructing the

.

are the eye

The above description is true for the case that the reflective or the refractive plane is parallel to X axis of the coordinate system. However, the rotation of the coordinate system is required for the case that the plane is inclined against X axis. Figure 3 shows the process of the vertex translation with the coordinate system rotation. In Figure 3(a), the plane is inclined against X axis by the angle ω. By the rotation, the plane becomes parallel to X axis, and the translation of the vertex A in Figure 3(b) is performed with the above process (the translated vertex is indicated as B in the figure). Then, the final vertex is obtained by the inverse rotation of the coordinate system.

#### 3.4 Combination of reflection and refraction

Figure 4 shows the case where both reflection and refraction happen on a parallel glass. M xm; ym is a vertex that constructs an original object, and D is the thickness of the parallel glass. The ray that has emitted from M xm; ym is refracted on the front plane of the glass and also reflected on the back plane. Then, the ray reaches the eye after it is refracted again on the front plane. If we can calculate the temporary virtual vertex for the reflection on the back plane, we can consider this phenomenon, which has two refractions and one reflection, as another phenomenon that has two refractions and no reflection with another parallel glass which thickness is 2D instead of D. In the figure, this temporary vertex is shown as M<sup>1</sup> xm; y<sup>1</sup> . In addition, if we can calculate the virtual vertex, we can consider the

Figure 4. Reflection and refraction on a parallel glass.

phenomenon as another phenomenon with no reflection and no refraction. This virtual vertex is shown as V xv; yv in the figure. If we can obtain the virtual vertex V xv; yv , we can draw the image without considering both reflection and refraction. The final virtual vertex V xv; yv is calculated as follows:

$$M\_1(\mathbf{x}\_m, \mathbf{y}\_1) = M\_1(\mathbf{x}\_m, \mathbf{y}\_m + 2\{T + D\}) = M\_1(\mathbf{x}\_m, \mathbf{y}\_m + 2\{|\mathbf{y}\_m - p| + D\})$$

$$= M\_1(\mathbf{x}\_m, 2p - \mathbf{y}\_m + 2D) \tag{8}$$

$$\text{2D} - \text{L}\_{\text{y}} = \text{2D} \tan(\phi) \tan\left\{ (\pi/2) - \theta \right\} = \text{2D} \tan\left(\phi\right) / \tan\left(\theta\right) \tag{9}$$

$$\therefore L\_{\mathcal{Y}} = 2D\{1 - \tan\left(\phi\right) / \tan\left(\theta\right)\}\tag{10}$$

We can also obtain the following equation from Eq. (4) by replacing ym with y1:

$$\tan\left(\theta\right) = \mathfrak{x}\_{\mathfrak{m}} / \left(\mathfrak{y}\_{\mathfrak{1}} - L\_{\mathfrak{I}}\right) \tag{11}$$

Figure 5 shows the relation between the number of repetitive reflections inside the parallel glass and the thickness of the virtual glass. The original thickness of the glass is D. When there is 1 ¼ 2k � 1 kð Þ ¼ 1 reflection inside the glass, we can consider the phenomenon as another phenomenon that has no reflection inside the glass and two refractions on the side planes with the parallel glass, which thickness is 2D ¼ 2kD kð Þ ¼ 1 . When the number of the reflection is 3 ¼ 2k � 1 kð Þ ¼ 2 or 5 ¼ 2k � 1 kð Þ ¼ 3 , the thickness of the glass becomes 4D ¼ 2kD kð Þ ¼ 2 4D or 6D ¼ 2kD kð Þ ¼ 3 , respectively.

When light enters the side plane of the glass, the incident angle changes. If the incident angle on the back plane of the glass is over the critical angle, total reflection happens. That is, there is no refraction and all light energy is reflected on the back plane. Even in this case, we can consider the phenomenon, which has one total reflection on the back plane and two refractions on the both side planes, as another phenomenon that has only two refractions on the side planes and no reflection on the back plane. In addition, we can generate the image by rendering the virtual object that has virtual vertices. Figure 6 illustrates this situation. In the figure, it is supposed that the back plane of the parallel glass is placed on y ¼ q, and the incident and refractive angles on the side planes are θ and ϕ, respectively. Then, the difference of the reflective angle ψ of the back plane and the critical angle ψ<sup>c</sup> , which is defined as sin �<sup>1</sup>ð Þ <sup>n</sup>1=n<sup>2</sup> , can be calculated as follows by using Eq. (5):

> 2 � � � <sup>ϕ</sup> n o � <sup>n</sup><sup>1</sup>

> > sin <sup>2</sup>

n2 � �<sup>2</sup>

ð Þ� <sup>θ</sup> <sup>n</sup><sup>1</sup> n2 � �<sup>2</sup> <sup>¼</sup> cos <sup>2</sup>

<sup>¼</sup> <sup>1</sup> � <sup>n</sup><sup>1</sup> n2 � �<sup>2</sup>

ð Þ� <sup>ϕ</sup> <sup>n</sup><sup>1</sup> n2 � �<sup>2</sup>

> <sup>1</sup> <sup>þ</sup> sin <sup>2</sup> ð Þ<sup>θ</sup> � �

> > (17)

3.5 Total reflection

Figure 5.

sin <sup>2</sup>

ð Þ� <sup>ϕ</sup> <sup>n</sup><sup>1</sup> n2 � �<sup>2</sup>

<sup>¼</sup> <sup>1</sup> � sin <sup>2</sup>

31

ð Þ� <sup>ψ</sup> sin <sup>2</sup> <sup>ψ</sup><sup>c</sup> ð Þ¼ sin <sup>2</sup> <sup>π</sup>

Relation between the number of reflection and the thickness of the glass.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

> <sup>¼</sup> <sup>1</sup> � <sup>n</sup><sup>1</sup> n2 � �<sup>2</sup>

By substituting Eqs. (5) and (11) for Eq.(10), the following equation is obtained:

$$\mathcal{X}\_m = \left(\mathcal{Y}\_1 - \mathfrak{D}\right) \tan\left(\theta\right) + \mathfrak{D} \text{tan}\left\{\sin^{-1}\left[\left(n\_1/n\_2\right)\sin\left(\theta\right)\right]\right\} \tag{12}$$

From Eq. (8), y<sup>1</sup> ¼ 2p � ym þ 2D. Then, Eq. (12) can be solved with an iterative method because θ varies depending on the positions of the eye and each object. If θ is decided, we can calculate the virtual vertex V xv; yv as follows:

$$V(\mathbf{x}\_v, \mathbf{y}\_v) = V(\mathbf{x}\_m, 2p - \mathbf{y}\_m + 2D - L\_\gamma) = V(\mathbf{x}\_m, 2p - \mathbf{y}\_m + 2D\{\tan\left(\phi\right)/\tan\left(\theta\right)\}) \tag{13}$$

The same calculation can be applied to the general phenomenon with n ¼ 2k � 1 kð Þ ≥ 1 repetitive reflections inside the parallel glass and two refractions on the front plane:

$$L\_{\gamma} = 2kD\{1 - \tan\left(\phi\right)/\tan\left(\theta\right)\}\tag{14}$$

$$\mathbf{x}\_m = \left\{ y\_1 - 2kD \right\} \tan\left(\theta\right) + 2kD \tan\left\{ \sin^{-1} \left[ \left( n\_1/n\_2 \right) \sin\left(\theta \right) \right] \right\} \tag{15}$$

$$V(\mathbf{x}\_v, \mathbf{y}\_v) = V(\mathbf{x}\_m, 2p - \mathbf{y}\_m + 2kD\{\tan\left(\phi\right)/\tan\left(\theta\right)\})\tag{16}$$

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 5.

phenomenon as another phenomenon with no reflection and no refraction. This

<sup>¼</sup> <sup>M</sup><sup>1</sup> xm; ym <sup>þ</sup> <sup>2</sup>f g <sup>T</sup> <sup>þ</sup> <sup>D</sup> <sup>¼</sup> <sup>M</sup><sup>1</sup> xm; ym <sup>þ</sup> <sup>2</sup> ym � <sup>p</sup>

, we can draw the image without considering both reflection and refrac-

is calculated as follows:

<sup>¼</sup> <sup>M</sup><sup>1</sup> xm; <sup>2</sup><sup>p</sup> � ym <sup>þ</sup> <sup>2</sup><sup>D</sup> (8)

∴ Ly ¼ 2Df g 1 � tan ð Þ ϕ = tan ð Þθ (10)

2D � Ly ¼ 2Dtanð Þ ϕ tan f g ð Þ� π=2 θ ¼ 2D tan ð Þ ϕ = tan ð Þθ (9)

We can also obtain the following equation from Eq. (4) by replacing ym with y1:

By substituting Eqs. (5) and (11) for Eq.(10), the following equation is obtained:

From Eq. (8), y<sup>1</sup> ¼ 2p � ym þ 2D. Then, Eq. (12) can be solved with an iterative method because θ varies depending on the positions of the eye and each object. If θ

The same calculation can be applied to the general phenomenon with

xm <sup>¼</sup> <sup>y</sup><sup>1</sup> � <sup>2</sup>kD tan ð Þþ <sup>θ</sup> <sup>2</sup>kDtan sin �<sup>1</sup>

n ¼ 2k � 1 kð Þ ≥ 1 repetitive reflections inside the parallel glass and two refractions

<sup>¼</sup> V xm; <sup>2</sup><sup>p</sup> � ym <sup>þ</sup> <sup>2</sup>D tan f g ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup>

tan ð Þ¼ θ xm= y<sup>1</sup> � Ly

xm <sup>¼</sup> <sup>y</sup><sup>1</sup> � <sup>2</sup><sup>D</sup> tan ð Þþ <sup>θ</sup> <sup>2</sup>Dtan sin �<sup>1</sup>

is decided, we can calculate the virtual vertex V xv; yv

<sup>¼</sup> V xm; <sup>2</sup><sup>p</sup> � ym <sup>þ</sup> <sup>2</sup><sup>D</sup> � Ly

V xv; yv

in the figure. If we can obtain the virtual vertex

 <sup>þ</sup> <sup>D</sup>

(11)

½ � ð Þ <sup>n</sup>1=n<sup>2</sup> sin ð Þ<sup>θ</sup> (12)

½ � ð Þ <sup>n</sup>1=n<sup>2</sup> sin ð Þ<sup>θ</sup> (15)

(13)

as follows:

Ly ¼ 2kDf g 1 � tan ð Þ ϕ = tan ð Þθ (14)

<sup>¼</sup> V xm; <sup>2</sup><sup>p</sup> � ym <sup>þ</sup> <sup>2</sup>kD tan f g ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> (16)

virtual vertex is shown as V xv; yv

Reflection and refraction on a parallel glass.

Computer Graphics and Imaging

M<sup>1</sup> xm; y<sup>1</sup>

tion. The final virtual vertex V xv; yv

V xv; yv

Figure 4.

V xv; yv

30

on the front plane:

Relation between the number of reflection and the thickness of the glass.

Figure 5 shows the relation between the number of repetitive reflections inside the parallel glass and the thickness of the virtual glass. The original thickness of the glass is D. When there is 1 ¼ 2k � 1 kð Þ ¼ 1 reflection inside the glass, we can consider the phenomenon as another phenomenon that has no reflection inside the glass and two refractions on the side planes with the parallel glass, which thickness is 2D ¼ 2kD kð Þ ¼ 1 . When the number of the reflection is 3 ¼ 2k � 1 kð Þ ¼ 2 or 5 ¼ 2k � 1 kð Þ ¼ 3 , the thickness of the glass becomes 4D ¼ 2kD kð Þ ¼ 2 4D or 6D ¼ 2kD kð Þ ¼ 3 , respectively.

#### 3.5 Total reflection

When light enters the side plane of the glass, the incident angle changes. If the incident angle on the back plane of the glass is over the critical angle, total reflection happens. That is, there is no refraction and all light energy is reflected on the back plane. Even in this case, we can consider the phenomenon, which has one total reflection on the back plane and two refractions on the both side planes, as another phenomenon that has only two refractions on the side planes and no reflection on the back plane. In addition, we can generate the image by rendering the virtual object that has virtual vertices. Figure 6 illustrates this situation. In the figure, it is supposed that the back plane of the parallel glass is placed on y ¼ q, and the incident and refractive angles on the side planes are θ and ϕ, respectively. Then, the difference of the reflective angle ψ of the back plane and the critical angle ψ<sup>c</sup> , which is defined as sin �<sup>1</sup>ð Þ <sup>n</sup>1=n<sup>2</sup> , can be calculated as follows by using Eq. (5):

$$\sin^2(\psi) - \sin^2(\psi\_c) = \sin^2\left\{\left(\frac{\pi}{2}\right) - \phi\right\} - \left(\frac{n\_1}{n\_2}\right)^2 = \cos^2(\phi) - \left(\frac{n\_1}{n\_2}\right)^2$$

$$= 1 - \sin^2(\phi) - \left(\frac{n\_1}{n\_2}\right)^2 = 1 - \left(\frac{n\_1}{n\_2}\right)^2 \sin^2(\theta) - \left(\frac{n\_1}{n\_2}\right)^2 = 1 - \left(\frac{n\_1}{n\_2}\right)^2 \left\{1 + \sin^2(\theta)\right\} \tag{17}$$

Figure 6. Total reflection.

Here, n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. n<sup>1</sup> is 1.0 and n<sup>1</sup> is in [1.43, 2.14] if we use the normal glass. Then, Eq. (17) is greater than 0.02 and always plus number. That means total reflection always happens on the back plane when light enters the side of the glass. Even in this case, we can consider the phenomenon, which has one total reflection on the back plane and two refractions on the both side planes of the parallel glass, as another phenomenon that has only two refractions on the side planes and no total reflection by using a virtual vertex shown as M<sup>1</sup> xm; y<sup>1</sup> in the figure. It is also supposed that the position of the back plane is y ¼ q.

From the figure, the following equations are obtained:

$$M\_1(\mathbf{x}\_m, \mathbf{y}\_1) = M\_1(\mathbf{x}\_m, \mathfrak{L}\mathbf{S} + \mathbf{y}\_m) = M\_1(\mathbf{x}\_m, \mathfrak{L}|\mathbf{y}\_m - q| + \mathbf{y}\_m) = M(\mathbf{x}\_m, \mathfrak{L}q - \mathbf{y}\_m) \tag{18}$$

$$(W - L\_{\infty})\tan\left(\theta\right) = \mathcal{W}\tan(\phi)\tag{19}$$

M<sup>2</sup> xm; y<sup>2</sup>

Two total reflections.

Figure 7.

V xv; yv

Figure 8.

33

Three total reflections.

and V xv; yv

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

another virtual vertex V xv; yv

are calculated as follows by using Eq. (20):

<sup>¼</sup> V xm � Lx; ym <sup>þ</sup> <sup>2</sup><sup>D</sup> <sup>¼</sup> V xm � <sup>W</sup>f g <sup>1</sup> � tan ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> ; ym <sup>þ</sup> <sup>2</sup><sup>D</sup>

Figure 8 shows another case that has three total reflections. Even in this case, we can consider the phenomenon as another one that has no total reflection and two

generate the image without considering any reflection and refraction by using

<sup>¼</sup> <sup>M</sup><sup>2</sup> xm; ym <sup>þ</sup> <sup>2</sup><sup>D</sup> (24)

(25)

. Then, we can

M<sup>2</sup> xm; y<sup>2</sup>

refractions on the both sides by using a virtual vertex M<sup>3</sup> xm; y<sup>3</sup>

.

$$\vdots . L\_{\ge} = W\{1 - \tan\left(\phi\right) / \tan\left(\theta\right)\}\tag{20}$$

$$\tan\left(\theta\right) = \mathcal{Y}\_1/(\mathbf{x}\_m - L\_\mathbf{x}) \left( \vdots \propto\_m \mathbf{z} \,\mathrm{L}\_\mathbf{x} \right) \tag{21}$$

With Eqs. (5), (20), and (21), the following equation is derived:

$$
\Delta q - y\_m = (\mathbf{x}\_m - \mathbf{W})\tan\left(\theta\right) + \mathbf{W}\tan\left\{\sin^{-1}[(n\_1/n\_2)\sin\left(\theta\right)]\right\}\tag{22}
$$

Then, the incident angle θ is calculated with an iterative method, and ϕ is also calculated with Eq. (5). Finally, the virtual vertex is obtained as the following:

$$V(\mathbf{x}\_v, \mathbf{y}\_v) = V(\mathbf{x}\_m - L\_{\mathbf{x}}, \mathbf{2}q - \mathbf{y}\_m) = V(\mathbf{x}\_m - W\{1 - \tan\left(\phi\right)/\tan\left(\theta\right)\}, \mathbf{2}q - \mathbf{y}\_m) \tag{23}$$

Figure 7 shows the case that has two total reflections. In this case, we can consider the phenomenon, which has two total reflections on the front and back planes, and two refractions on the both sides, as another phenomenon that has one total reflection on the back plane and two refractions on the both sides by using a virtual vertex M<sup>1</sup> xm; y<sup>1</sup> . In addition, we can consider the phenomenon as another phenomenon that has no total reflection and two refractions on the both sides by using another virtual vertex M<sup>2</sup> xm; y<sup>2</sup> . Finally, we can consider the phenomenon as another one that has no total reflection and no refraction by using V xv; yv .

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 7. Two total reflections.

Here, n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. n<sup>1</sup> is 1.0 and n<sup>1</sup> is in [1.43, 2.14] if we use the normal glass. Then, Eq. (17) is greater than 0.02 and always plus number. That means total reflection always happens on the back plane when light enters the side of the glass. Even in this case, we can consider the phenomenon, which has one total reflection on the back plane and two refractions on the both side planes of the parallel glass, as another phenomenon that has only two refractions on the side planes and no total reflection by using a

in the figure. It is also supposed that the position

 þ ym <sup>¼</sup> M xm; <sup>2</sup><sup>q</sup> � ym

½ � ð Þ <sup>n</sup>1=n<sup>2</sup> sin ð Þ<sup>θ</sup> (22)

ð Þ W � Lx tan ð Þ¼ θ Wtanð Þ ϕ (19) ∴ Lx ¼ Wf g 1 � tan ð Þ ϕ = tan ð Þθ (20) tan ð Þ¼ θ y1=ð Þ xm � Lx ð Þ ∵ xm ≥Lx (21)

(18)

(23)

.

virtual vertex shown as M<sup>1</sup> xm; y<sup>1</sup>

<sup>¼</sup> <sup>M</sup><sup>1</sup> xm; <sup>2</sup><sup>S</sup> <sup>þ</sup> ym

<sup>¼</sup> V xm � Lx; <sup>2</sup><sup>q</sup> � ym

using another virtual vertex M<sup>2</sup> xm; y<sup>2</sup>

From the figure, the following equations are obtained:

<sup>¼</sup> <sup>M</sup><sup>1</sup> xm; <sup>2</sup> ym � <sup>q</sup>

With Eqs. (5), (20), and (21), the following equation is derived:

Then, the incident angle θ is calculated with an iterative method, and ϕ is also calculated with Eq. (5). Finally, the virtual vertex is obtained as the following:

Figure 7 shows the case that has two total reflections. In this case, we can consider the phenomenon, which has two total reflections on the front and back planes, and two refractions on the both sides, as another phenomenon that has one total reflection on the back plane and two refractions on the both sides by using a

phenomenon that has no total reflection and two refractions on the both sides by

as another one that has no total reflection and no refraction by using V xv; yv

<sup>¼</sup> V xm � <sup>W</sup>f g <sup>1</sup> � tan ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> ; <sup>2</sup><sup>q</sup> � ym

. In addition, we can consider the phenomenon as another

. Finally, we can consider the phenomenon

<sup>2</sup><sup>q</sup> � ym <sup>¼</sup> ð Þ xm � <sup>W</sup> tan ð Þþ <sup>θ</sup> Wtan sin �<sup>1</sup>

of the back plane is y ¼ q.

Computer Graphics and Imaging

M<sup>1</sup> xm; y<sup>1</sup>

Figure 6. Total reflection.

V xv; yv

32

virtual vertex M<sup>1</sup> xm; y<sup>1</sup>

M<sup>2</sup> xm; y<sup>2</sup> and V xv; yv are calculated as follows by using Eq. (20):

$$M\_2(\mathbf{x}\_m, y\_2) = M\_2(\mathbf{x}\_m, y\_m + 2D) \tag{24}$$

$$V(\mathbf{x}\_v, \mathbf{y}\_v) = V(\mathbf{x}\_m - L\_{\mathbf{x}}, \mathbf{y}\_m + 2D) = V(\mathbf{x}\_m - W\{1 - \tan\left(\phi\right)/\tan\left(\theta\right)\}, \mathbf{y}\_m + 2D) \tag{25}$$

Figure 8 shows another case that has three total reflections. Even in this case, we can consider the phenomenon as another one that has no total reflection and two refractions on the both sides by using a virtual vertex M<sup>3</sup> xm; y<sup>3</sup> . Then, we can generate the image without considering any reflection and refraction by using another virtual vertex V xv; yv .

Figure 8. Three total reflections.

M<sup>3</sup> xm; y<sup>3</sup> � � and V xv; yv � � are calculated as follows by using Eq. (20):

$$M\_3(\mathbf{x}\_m, \mathbf{y}\_3) = M\_3(\mathbf{x}\_m, \mathbf{y}\_m + 2\{\mathbf{S} + D\}) = M\_3(\mathbf{x}\_m, \mathbf{y}\_m + 2\{\left|\mathbf{y}\_m - q\right| + D\})$$

$$= M\_3(\mathbf{x}\_m, 2q - \mathbf{y}\_m + 2D) \tag{26}$$

$$\begin{split} V(\mathbf{x}\_{\nu}, \mathbf{y}\_{\nu}) &= V(\mathbf{x}\_{m} - \mathbf{L}\_{\mathbf{x}}, \mathbf{2q} - \mathbf{y}\_{m} + \mathbf{2D}) \\ &= V(\mathbf{x}\_{m} - \mathbf{W}\{1 - \tan\left(\phi\right) / \tan\left(\theta\right)\}, \mathbf{2q} - \mathbf{y}\_{m} + \mathbf{2D}) \end{split} \tag{27}$$

The same calculation can be applied to the case that has n total reflections inside the glass. In fact, V xn; yn � � is classified to two types depending on the number of total reflection as the following:

$$V(\mathbf{x}\_v, \mathbf{y}\_v) = \newline \begin{cases} V(\mathbf{x}\_m - W\{\mathbf{1} - \tan\left(\phi\right)/\tan\left(\theta\right)\}, 2q - \mathbf{y}\_m + (n - 1)D \ \big| & (n = 2k - 1, k \ge 1) \\\ V(\mathbf{x}\_m - W\{\mathbf{1} - \tan\left(\phi\right)/\tan\left(\theta\right)\}, \mathbf{y}\_m + nD \ \big| & (n = 2k, k \ge 1) \end{cases} \tag{28}$$

#### 3.6 Attenuation

Figure 9 shows the case that has multiple reflections and refractions in the parallel glass, where light energy attenuates gradually every time reflection or refraction happens.

Fresnel equations mention that the reflection rate changes depending on the incident angle; however, the following approximated equation is usually used for the reflection rate calculation in computer graphics field:

$$F\_r(\theta) = F\_0 + (\mathbf{1} - F\_0)(\mathbf{1} - \cos\left(\theta\right))^5 \tag{29}$$

$$F\_0 = \{ (n\_1 - n\_2)/(n\_1 + n\_2) \}\tag{30}$$

4. Cubed glass

Multiple reflections and refractions.

Figure 9.

Figure 10.

35

Reflective and refractive image on a cubed glass.

4.1 Analysis of reflection and refraction

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 10 shows an image generated on a cubed glass, which image has some reflections and refractions. We can estimate that there is a string of "GRAPHICS" under the cubed glass; however, we do not know how the image is generated and which part has the effect of reflection, refraction, or the combination. We can see that the top plane is divided into four regions and some images are flipped horizontally, vertically, or on both directions. On the other hand, Figure 11 illustrates the ray path in the cubed glass. In Figures 10 and 11, eight points indicated as A to H are the vertices constructing the cubed glass. In Figure 10, four numbers

where θ is the incident angle and n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. In addition, F<sup>0</sup> is the reflection rate in the case that light enters the plane perpendicularly. If the total energy of light is 1, the summation of the first reflective light energy (R1) and the first transmitted light energy (T1) should be 1. Then, the reflective and the refractive energies after n reflections and refractions can be calculated as follows if there is no energy loss:

$$R\_1 = F\_r(\theta) \tag{31}$$

$$T\_1 = \mathbf{1} - R\_1 = \mathbf{1} - F\_r(\theta) \tag{32}$$

$$R\_2 = T\_1 F\_r(\phi) = \{1 - F\_r(\theta)\} F\_r(\phi) \tag{33}$$

$$T\_2 = T\_1 \{ \mathbf{1} - F\_r(\phi) \} = \{ \mathbf{1} - F\_r(\theta) \} \{ \mathbf{1} - F\_r(\phi) \} \tag{34}$$

$$R\_3 = R\_2 F\_r(\phi) = \{1 - F\_r(\theta)\} F\_r(\phi)^2 \tag{35}$$

$$T\_3 = R\_2 \{ 1 - F\_r(\phi) \} = \{ 1 - F\_r(\theta) \} F\_r(\phi) \{ 1 - F\_r(\phi) \} \tag{36}$$

$$R\_n = \{\mathbf{1} - F\_r(\theta)\} F\_r(\phi)^{n-1} \ (n \ge 2) \tag{37}$$

$$T\_n = \{\mathbf{1} - F\_r(\theta)\} F\_r(\phi)^{n-2} \{\mathbf{1} - F\_r(\phi)\} \ (n \ge 2) \tag{38}$$

In the rendering, the reflection and the refraction rates are used as an alpha value for alpha blending, when multiple images are combined together.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 9. Multiple reflections and refractions.

## 4. Cubed glass

M<sup>3</sup> xm; y<sup>3</sup>

M<sup>3</sup> xm; y<sup>3</sup>

V xv; yv

the glass. In fact, V xn; yn

V xv; yv � � <sup>¼</sup>

3.6 Attenuation

refraction happens.

(

34

total reflection as the following:

� � and V xv; yv

Computer Graphics and Imaging

� � <sup>¼</sup> V xm � Lx; <sup>2</sup><sup>q</sup> � ym <sup>þ</sup> <sup>2</sup><sup>D</sup> � �

the reflection rate calculation in computer graphics field:

refractions can be calculated as follows if there is no energy loss:

Tn <sup>¼</sup> f g <sup>1</sup> � Frð Þ<sup>θ</sup> Frð Þ <sup>ϕ</sup> <sup>n</sup>�<sup>2</sup>

value for alpha blending, when multiple images are combined together.

In the rendering, the reflection and the refraction rates are used as an alpha

� � are calculated as follows by using Eq. (20):

<sup>¼</sup> <sup>M</sup><sup>3</sup> xm; <sup>2</sup><sup>q</sup> � ym <sup>þ</sup> <sup>2</sup><sup>D</sup> � � (26)

<sup>¼</sup> V xm � <sup>W</sup>f g <sup>1</sup> � tan ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> ; <sup>2</sup><sup>q</sup> � ym <sup>þ</sup> <sup>2</sup><sup>D</sup> � � (27)

� � is classified to two types depending on the number of

Frð Þ¼ <sup>θ</sup> <sup>F</sup><sup>0</sup> <sup>þ</sup> ð Þ <sup>1</sup> � <sup>F</sup><sup>0</sup> ð Þ <sup>1</sup> � cosð Þ<sup>θ</sup> <sup>5</sup> (29)

F<sup>0</sup> ¼ f g ð Þ n<sup>1</sup> � n<sup>2</sup> =ð Þ n<sup>1</sup> þ n<sup>2</sup> (30)

R<sup>1</sup> ¼ Frð Þθ (31)

f g 1 � Frð Þ ϕ ð Þ n ≥2 (38)

T<sup>1</sup> ¼ 1 � R<sup>1</sup> ¼ 1 � Frð Þθ (32) R<sup>2</sup> ¼ T1Frð Þ¼ ϕ f g 1 � Frð Þθ Frð Þ ϕ (33)

T<sup>2</sup> ¼ T1f g 1 � Frð Þ ϕ ¼ f g 1 � Frð Þθ f g 1 � Frð Þ ϕ (34)

T<sup>3</sup> ¼ R2f g 1 � Frð Þ ϕ ¼ f g 1 � Frð Þθ Frð Þ ϕ f g 1 � Frð Þ ϕ (36)

<sup>R</sup><sup>3</sup> <sup>¼</sup> <sup>R</sup>2Frð Þ¼ <sup>ϕ</sup> f g <sup>1</sup> � Frð Þ<sup>θ</sup> Frð Þ <sup>ϕ</sup> <sup>2</sup> (35)

Rn <sup>¼</sup> f g <sup>1</sup> � Frð Þ<sup>θ</sup> Frð Þ <sup>ϕ</sup> <sup>n</sup>�<sup>1</sup> ð Þ <sup>n</sup> <sup>≥</sup><sup>2</sup> (37)

The same calculation can be applied to the case that has n total reflections inside

V xm � <sup>W</sup>f g <sup>1</sup> � tan ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> ; <sup>2</sup><sup>q</sup> � ym <sup>þ</sup> ð Þ <sup>n</sup> � <sup>1</sup> <sup>D</sup> � � ð Þ <sup>n</sup> <sup>¼</sup> <sup>2</sup><sup>k</sup> � <sup>1</sup>; <sup>k</sup>≥<sup>1</sup> V xm � <sup>W</sup>f g <sup>1</sup> � tan ð Þ <sup>ϕ</sup> <sup>=</sup> tan ð Þ<sup>θ</sup> ; ym <sup>þ</sup> nD � � ð Þ <sup>n</sup> <sup>¼</sup> <sup>2</sup>k; <sup>k</sup>≥<sup>1</sup>

Figure 9 shows the case that has multiple reflections and refractions in the parallel glass, where light energy attenuates gradually every time reflection or

Fresnel equations mention that the reflection rate changes depending on the incident angle; however, the following approximated equation is usually used for

where θ is the incident angle and n<sup>1</sup> and n<sup>2</sup> are the refractive indices of the air and the glass, respectively. In addition, F<sup>0</sup> is the reflection rate in the case that light enters the plane perpendicularly. If the total energy of light is 1, the summation of the first reflective light energy (R1) and the first transmitted light energy (T1) should be 1. Then, the reflective and the refractive energies after n reflections and

� � � <sup>þ</sup> <sup>D</sup> � � � �

(28)

� � <sup>¼</sup> <sup>M</sup><sup>3</sup> xm; ym <sup>þ</sup> <sup>2</sup>f g <sup>S</sup> <sup>þ</sup> <sup>D</sup> � � <sup>¼</sup> <sup>M</sup><sup>3</sup> xm; ym <sup>þ</sup> <sup>2</sup> ym � <sup>q</sup> �

#### 4.1 Analysis of reflection and refraction

Figure 10 shows an image generated on a cubed glass, which image has some reflections and refractions. We can estimate that there is a string of "GRAPHICS" under the cubed glass; however, we do not know how the image is generated and which part has the effect of reflection, refraction, or the combination. We can see that the top plane is divided into four regions and some images are flipped horizontally, vertically, or on both directions. On the other hand, Figure 11 illustrates the ray path in the cubed glass. In Figures 10 and 11, eight points indicated as A to H are the vertices constructing the cubed glass. In Figure 10, four numbers

Figure 10. Reflective and refractive image on a cubed glass.

6) If the length of AQ is shorter than that of AE, set the middle point of C0

Boundary line search algorithm. (a) Process of 1-5 (b) In case of AQ<AE and (c) In case of AQ>AE.

Figure 13 shows the simulation result with the proposed method for the case of Figure 10 and the comparison with the real photo. The top plane is divided into four regions, and the images on some regions are flipped due to total reflection on the

Figure 14 shows another simulation result and the real photo for an eraser that has texture on the surfaces. In this case, the front plane is divided into four regions, and some images on the regions are flipped due to total reflection. We can see that

Figure 15 shows the process to generate Figure 14(a). Figure 15(c) is the image

Simulation result and the real photo for a string of "GRAPHICS." (a) Simulation result and (b) Real photograph.

without reflection and refraction because the part is directly seen from the eye position and the ray does not pass the cubed glass. All images except for (c) have two refractions on the back and the front planes. The image (b) has only two refractions on the back and the front planes of the cubed glass. It does not have any total reflection. On the other hand, the image (a) has one total reflection on the side

the next point of P, and set the original P as A<sup>0</sup>

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

4.2 Simulation with a cubed glass

the two images are very similar.

P as the next point of P and set the original P as C<sup>0</sup>

A0

Figure 12.

side planes.

Figure 13.

37

P as

. Otherwise, set the middle point of

.

#### Figure 11.

Ray path in a cubed glass. (a) YZ cross section and (b) XY cross section.

indicated as (1) to (4) show the divided regions on the top plane, and in Figure 11, the same four numbers show four rays that pass the same regions as those in Figure 10. In addition, Figure 11 shows that the numbers outside the parenthesis are near to the eye point, while the numbers inside the parenthesis are far from the eye. Each divided region in Figure 10 has the effect of reflection and/or refraction as the following:

(1) Two refractions on the bottom and the top planes.

(2) Two refractions on the bottom and the top planes and one total reflection on the side of ABFE.

(3) Two refractions on the bottom and the top planes and one total reflection on the side of BDHF.

(4) Two refractions on the bottom and the top planes and two reflections on two sides of ABFE and BDHF.

For generation of the image drawn on the top plane of the cubed glass, we need to decide the boundary between regions. In Figure 10, the image is flipped on the boundary line, and the flip is caused by total reflection inside the cubed glass. For example, the region (2) has one total reflection on the side of ABFE in addition to two refractions on the bottom and the top planes. Then, the boundary line on the top plane can be decided by the ray that passes the bottom edge line (EF) of the cubed glass. In addition, the boundary line between the regions (1) and (2) or the regions (3) and (4) is parallel to Z axis, and the boundary line between the regions (1) and (3) or the regions (2) and (4) is parallel to X axis. Therefore, the searching algorithm is as follows for the boundary line that divides the regions (1) and (3) or the regions (2) and (4). Figure 12 shows the process of the algorithm:

<Boundary line search algorithm>

1) Set A as A<sup>0</sup> and C as C<sup>0</sup> .

2) Set the initial point P as the middle point of A<sup>0</sup> C0 .

3) Calculate the refractive light with the incident and the refractive angles (θ and ϕ).

4) Calculate the intersection point of the refractive light and the line of AE, and set the point as Q.

5) If Q nearly equals to E, the line that passes P and is parallel to X axis is the boundary. Stop here.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 12. Boundary line search algorithm. (a) Process of 1-5 (b) In case of AQ<AE and (c) In case of AQ>AE.

6) If the length of AQ is shorter than that of AE, set the middle point of C0 P as the next point of P, and set the original P as A<sup>0</sup> . Otherwise, set the middle point of A0 P as the next point of P and set the original P as C<sup>0</sup> .

### 4.2 Simulation with a cubed glass

indicated as (1) to (4) show the divided regions on the top plane, and in Figure 11, the same four numbers show four rays that pass the same regions as those in Figure 10. In addition, Figure 11 shows that the numbers outside the parenthesis are near to the eye point, while the numbers inside the parenthesis are far from the eye. Each divided region in Figure 10 has the effect of reflection and/or refraction

(2) Two refractions on the bottom and the top planes and one total reflection on

(3) Two refractions on the bottom and the top planes and one total reflection on

(4) Two refractions on the bottom and the top planes and two reflections on two

For generation of the image drawn on the top plane of the cubed glass, we need to decide the boundary between regions. In Figure 10, the image is flipped on the boundary line, and the flip is caused by total reflection inside the cubed glass. For example, the region (2) has one total reflection on the side of ABFE in addition to two refractions on the bottom and the top planes. Then, the boundary line on the top plane can be decided by the ray that passes the bottom edge line (EF) of the cubed glass. In addition, the boundary line between the regions (1) and (2) or the regions (3) and (4) is parallel to Z axis, and the boundary line between the regions (1) and (3) or the regions (2) and (4) is parallel to X axis. Therefore, the searching algorithm is as follows for the boundary line that divides the regions (1) and (3) or

> C0 .

the regions (2) and (4). Figure 12 shows the process of the algorithm:

3) Calculate the refractive light with the incident and the refractive angles

4) Calculate the intersection point of the refractive light and the line of AE, and

5) If Q nearly equals to E, the line that passes P and is parallel to X axis is the

. 2) Set the initial point P as the middle point of A<sup>0</sup>

(1) Two refractions on the bottom and the top planes.

Ray path in a cubed glass. (a) YZ cross section and (b) XY cross section.

as the following:

Figure 11.

the side of ABFE.

the side of BDHF.

sides of ABFE and BDHF.

Computer Graphics and Imaging

<Boundary line search algorithm>

1) Set A as A<sup>0</sup> and C as C<sup>0</sup>

(θ and ϕ).

36

set the point as Q.

boundary. Stop here.

Figure 13 shows the simulation result with the proposed method for the case of Figure 10 and the comparison with the real photo. The top plane is divided into four regions, and the images on some regions are flipped due to total reflection on the side planes.

Figure 14 shows another simulation result and the real photo for an eraser that has texture on the surfaces. In this case, the front plane is divided into four regions, and some images on the regions are flipped due to total reflection. We can see that the two images are very similar.

Figure 15 shows the process to generate Figure 14(a). Figure 15(c) is the image without reflection and refraction because the part is directly seen from the eye position and the ray does not pass the cubed glass. All images except for (c) have two refractions on the back and the front planes. The image (b) has only two refractions on the back and the front planes of the cubed glass. It does not have any total reflection. On the other hand, the image (a) has one total reflection on the side

Figure 13. Simulation result and the real photo for a string of "GRAPHICS." (a) Simulation result and (b) Real photograph.

Figure 14.

Simulation result and the real photo for an eraser with texture. (a) Simulation result and (b) Real photograph.

combined image. Then, we can understand which part is generated by reflection

Divided images and the combined image generated on three planes. (a) No reflection on left front (b) No refraction on right front (c) Direct reflection on top (d) Total reflection on left bottom (e) Total reflection on

Simulation result and the real photo for an image generated on three planes. (a) Simulation result and (b) Real

In Figures 13 and 14, the simulation result has an image only on one plane: top or front. However, the method can be applied to multiple planes. Figure 16 shows

and/or refraction by using the proposed method.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

Figure 16.

photograph.

Figure 17.

39

right bottom and (f) Combined image.

the application, where the images are generated on three planes.

Figure 15.

Divided images and the combined image generated on one plane. (a) Reflection on side (b) No reflection (c) Image outside the class (d) Total reflections on side and bottom (e) Total reflection on bottom and (d) Combined image.

plane so that the string on the eraser is generated by flipping the image (b) horizontally. The image (e) also has only one total reflection on the bottom plane so that the image is generated by flipping the image (b) vertically. In addition, the image (d) has two total reflections on the side and the bottom so that the image is generated by flipping the image (b) horizontally and vertically. The image (f) is the Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

#### Figure 16.

Simulation result and the real photo for an image generated on three planes. (a) Simulation result and (b) Real photograph.

combined image. Then, we can understand which part is generated by reflection and/or refraction by using the proposed method.

In Figures 13 and 14, the simulation result has an image only on one plane: top or front. However, the method can be applied to multiple planes. Figure 16 shows the application, where the images are generated on three planes.

#### Figure 17.

Divided images and the combined image generated on three planes. (a) No reflection on left front (b) No refraction on right front (c) Direct reflection on top (d) Total reflection on left bottom (e) Total reflection on right bottom and (f) Combined image.

plane so that the string on the eraser is generated by flipping the image (b) horizontally. The image (e) also has only one total reflection on the bottom plane so that the image is generated by flipping the image (b) vertically. In addition, the image (d) has two total reflections on the side and the bottom so that the image is

Divided images and the combined image generated on one plane. (a) Reflection on side (b) No reflection (c) Image outside the class (d) Total reflections on side and bottom (e) Total reflection on bottom and (d)

Simulation result and the real photo for an eraser with texture. (a) Simulation result and (b) Real photograph.

Figure 14.

Computer Graphics and Imaging

Figure 15.

38

Combined image.

generated by flipping the image (b) horizontally and vertically. The image (f) is the

In addition, Figure 17 shows the process to generate Figure 16(a). In the figure, all parts have an image seen directly from the eye position, so that it has no reflection and refraction. The image (c) has no total reflection and refraction. It has only the direct reflection of the eraser on the top plane; however, it is difficult to identify it because the image is not so clear, which is the same as that of the real photo (Figure 16(b)). Both (a) and (b) have only two refractions; however, the refractive planes are different. The refractive planes are parallel since there is no total reflection. The one is the plane that has the image, and the other is the plane that is parallel to it. On the other hand, both (e) and (f) have one total reflection on the bottom plane so that the string on the eraser is vertically flipped. The images (d) and (e) are generated by flipping the images (a) and (b) vertically, respectively. Finally, (f) is the combined image. The process of the image generation helps us to understand which part is generated by reflection and/or refraction.

## 5. Cylindrical glass

### 5.1 Movement of virtual vertex

This section describes how to generate the image for a cylindrical glass. In the inside of a cylindrical glass, there are four refractions at the most, and the position of a virtual vertex moves dynamically. Figure 18 shows the movement of a virtual vertex by each refraction through a cylindrical glass. In the figure, the thickness of the cylindrical glass is W, and Q is the original vertex. Vertex Q is directly seen from point D; however, the ray is refracted at point D so that the vertex cannot be directly seen from point C. If the vertex moves from Q to QD, it is directly seen from point C. The same movement should be done for the rest. If vertex QD moves to QC, it can be directly seen from point B, and if vertex QC moves to QB, then it can also be directly seen from point A. Finally, if vertex QB moves to QA, then it can be directly seen from the eye position.

the same method. Vertex Qc is calculated as the intersection between the line that passes B and C and another line that passes point QD and is parallel to the line OC. The vertex QB is calculated as the intersection between the line that passes A and B and another line that passes point Qc and is parallel to the line OB. Finally, virtual vertex Q<sup>0</sup> ¼ QA is solved as the intersection between the line that passes A and E

Simulation result and the real photo for a cylindrical glass. (a) Simulation result and (b) Real photograph.

If the final virtual vertex Q<sup>0</sup> is obtained, we can generate the refractive image just by rendering the objects constructed with virtual vertices without considering

Figure 19 shows the simulation image generated with the proposed method and the real photo. The eraser is distorted inside the cylindrical glass due to four refractions. The simulation result is very similar to the real photo, and the image can be generated in real time. That is, the simulation image changes in real time according

In this chapter, a new method to generate reflective and refractive images has been proposed. The method generates virtual objects that have virtual vertices translated from the original ones by considering reflection and refraction. By rendering the virtual objects, we can generate the reflective and/or refractive images without considering reflection and refraction. For the parallel glass, the calculation equations for the virtual vertex have been derived. In addition, total reflection and attenuation of light energy have been considered, and the attenuation is used as an alpha value to blend some images in alpha blending. On the other hand, the position of a virtual vertex moves dynamically for a cylindrical glass, and the position can be calculated as the intersection of two lines. Finally, the proposed method has been applied to two types of glass: cubed glass and cylindrical glass. On the both cases,

and another line that passes point QB and is parallel to the line OA.

any refraction.

41

Figure 19.

5.2 Simulation with a cylindrical glass

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

to the movement of the real eraser.

6. Conclusion and future work

Then, each virtual vertex can be calculated as follows. The virtual Vertex QD is calculated as the intersection between the line that passes C and D and another line that passes point Q and is parallel to the line OD. The remains are calculated with

Figure 18. Movement of a virtual vertex.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

#### Figure 19.

In addition, Figure 17 shows the process to generate Figure 16(a). In the figure,

reflection and refraction. The image (c) has no total reflection and refraction. It has only the direct reflection of the eraser on the top plane; however, it is difficult to identify it because the image is not so clear, which is the same as that of the real photo (Figure 16(b)). Both (a) and (b) have only two refractions; however, the refractive planes are different. The refractive planes are parallel since there is no total reflection. The one is the plane that has the image, and the other is the plane that is parallel to it. On the other hand, both (e) and (f) have one total reflection on the bottom plane so that the string on the eraser is vertically flipped. The images (d) and (e) are generated by flipping the images (a) and (b) vertically, respectively. Finally, (f) is the combined image. The process of the image generation helps us to

This section describes how to generate the image for a cylindrical glass. In the inside of a cylindrical glass, there are four refractions at the most, and the position of a virtual vertex moves dynamically. Figure 18 shows the movement of a virtual vertex by each refraction through a cylindrical glass. In the figure, the thickness of the cylindrical glass is W, and Q is the original vertex. Vertex Q is directly seen from point D; however, the ray is refracted at point D so that the vertex cannot be directly seen from point C. If the vertex moves from Q to QD, it is directly seen from point C. The same movement should be done for the rest. If vertex QD moves to QC, it can be directly seen from point B, and if vertex QC moves to QB, then it can also be directly seen from point A. Finally, if vertex QB moves to QA, then it can

Then, each virtual vertex can be calculated as follows. The virtual Vertex QD is calculated as the intersection between the line that passes C and D and another line that passes point Q and is parallel to the line OD. The remains are calculated with

all parts have an image seen directly from the eye position, so that it has no

understand which part is generated by reflection and/or refraction.

5. Cylindrical glass

Computer Graphics and Imaging

Figure 18.

40

Movement of a virtual vertex.

5.1 Movement of virtual vertex

be directly seen from the eye position.

Simulation result and the real photo for a cylindrical glass. (a) Simulation result and (b) Real photograph.

the same method. Vertex Qc is calculated as the intersection between the line that passes B and C and another line that passes point QD and is parallel to the line OC. The vertex QB is calculated as the intersection between the line that passes A and B and another line that passes point Qc and is parallel to the line OB. Finally, virtual vertex Q<sup>0</sup> ¼ QA is solved as the intersection between the line that passes A and E and another line that passes point QB and is parallel to the line OA.

If the final virtual vertex Q<sup>0</sup> is obtained, we can generate the refractive image just by rendering the objects constructed with virtual vertices without considering any refraction.

#### 5.2 Simulation with a cylindrical glass

Figure 19 shows the simulation image generated with the proposed method and the real photo. The eraser is distorted inside the cylindrical glass due to four refractions. The simulation result is very similar to the real photo, and the image can be generated in real time. That is, the simulation image changes in real time according to the movement of the real eraser.

### 6. Conclusion and future work

In this chapter, a new method to generate reflective and refractive images has been proposed. The method generates virtual objects that have virtual vertices translated from the original ones by considering reflection and refraction. By rendering the virtual objects, we can generate the reflective and/or refractive images without considering reflection and refraction. For the parallel glass, the calculation equations for the virtual vertex have been derived. In addition, total reflection and attenuation of light energy have been considered, and the attenuation is used as an alpha value to blend some images in alpha blending. On the other hand, the position of a virtual vertex moves dynamically for a cylindrical glass, and the position can be calculated as the intersection of two lines. Finally, the proposed method has been applied to two types of glass: cubed glass and cylindrical glass. On the both cases,

the simulation results have been very similar to the real photos, and the image can be generated in real time.

References

1979. p. 14

23(6):343-349

1984. pp. 119-127

1976;19(10):542-547

191-214

[1] Whitted T. An improved

[2] Whitted T. An improved

illumination model for shaded display. In: Proceedings of the ACM SIGGRAPH;

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

In: Proceedings of Computer Graphics

[11] Wang W, Wang L, Lin S, Wang J, Guo B. Real-time environment map interpolation. In: Proceedings of the 3rd International Conference on Image and

[12] Wyman C. Interactive image-space refraction of nearby geometry. In: Proceedings of the 3rd International Conference on Computer Graphics and Interactive Technique in Australasia and

Forum. 2003;22(3):601-609

Graphics; 2004. pp. 382-389

South Asia; 2005. pp. 205-211

[13] Hu W, Qin K. Interactive

pp. 89-96

1591-1602

pp. 747-753

2006;68:432-450

approximate rendering of reflections, refractions, and caustics. IEEE Transactions on Visualization and Computer Graphics. 2007;13(1):46-57

[14] Oliveira M, Brauwers M. Real-time refraction through deformable objects. In: Proceedings of the 2007 Symposium on Interactive 3D Graphics; 2007.

[15] Rodgman D, Chen M. Refraction in volume graphics. Graphical Models.

[16] Rousiers C, Bousseau A, Subr K, Holzchuch N, Ramamoorthi R. Realtime rendering of rough refraction. IEEE Transactions on Visualization and Computer Graphics. 2012;18(10):

[17] Chen Z, Wong KK. Depth from refraction using a transparent medium with unknown pose and refractive index. International Journal of Computer Vision. 2013;102(1–3):3-17

[18] Mukai N, Makino Y, Chang Y. Ray tracing based fast refraction method for an object seen through a cylindrical glass. In: Proceedings of MODSIM; 2013.

illumination model for shaded display. Communications of the ACM. 1980;

[3] Heckbert P, Hanrahan P. Beam tracing polygonal objects. In:

[4] Amanatides J. Ray tracing with cones. In: Proceedings of the ACM SIGGRAPH; 1984. pp. 129-135

[5] Blinn JF, Newell ME. Texture and reflection in computer generated images. Communications of the ACM.

[6] Pauline T, Brian B. Modeling and rendering waves: Wave-tracing using beta-splines and reflective and refractive texture mapping. ACM Transactions on Graphics. 1987;6(3):

[7] Hakura Z, Snyder J, Lengyel J. Parameterized environment maps. In: Proceedings of the ACM Symposium on

[8] G'enevaux O, Larue F, Dischler J. Interactive refraction on complex static geometry using spherical harmonics. In: Proceedings of the ACM Symposium on

[9] Ofek E, Rappoport A. Interactive reflections on curved objects. In: Proceedings of the ACM SIGGRAPH;

[10] Iwasaki K, Dobashi Y, Nishita T. A fast rendering method for refractive and reflective caustics due to water surfaces.

I3D; 2001. pp. 203-208

I3D; 2006. pp. 145-152

1998. pp. 333-342

43

Proceedings of the ACM SIGGRAPH;

The proposed method helps us to understand which part of the image is generated by refraction, reflection, or total reflection. In addition, we can understand on which plane the reflection happens or which pair of planes causes the refraction. However, by comparing the simulation results with the real photos, we see that the image quality is different, especially the transparency. Then, in order to improve the image quality, we have to try another technique such as blending the simulation result with environment map.

## Author details

Nobuhiko Mukai Tokyo City University, Tokyo, Japan

\*Address all correspondence to: mukai@cs.tcu.ac.jp

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Analytical Method for Reflection and Refraction DOI: http://dx.doi.org/10.5772/intechopen.82147

## References

the simulation results have been very similar to the real photos, and the image can

The proposed method helps us to understand which part of the image is generated by refraction, reflection, or total reflection. In addition, we can understand on which plane the reflection happens or which pair of planes causes the refraction. However, by comparing the simulation results with the real photos, we see that the image quality is different, especially the transparency. Then, in order to improve the image quality, we have to try another technique such as blending the simulation

be generated in real time.

Computer Graphics and Imaging

result with environment map.

Author details

Nobuhiko Mukai

42

Tokyo City University, Tokyo, Japan

provided the original work is properly cited.

\*Address all correspondence to: mukai@cs.tcu.ac.jp

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

[1] Whitted T. An improved illumination model for shaded display. In: Proceedings of the ACM SIGGRAPH; 1979. p. 14

[2] Whitted T. An improved illumination model for shaded display. Communications of the ACM. 1980; 23(6):343-349

[3] Heckbert P, Hanrahan P. Beam tracing polygonal objects. In: Proceedings of the ACM SIGGRAPH; 1984. pp. 119-127

[4] Amanatides J. Ray tracing with cones. In: Proceedings of the ACM SIGGRAPH; 1984. pp. 129-135

[5] Blinn JF, Newell ME. Texture and reflection in computer generated images. Communications of the ACM. 1976;19(10):542-547

[6] Pauline T, Brian B. Modeling and rendering waves: Wave-tracing using beta-splines and reflective and refractive texture mapping. ACM Transactions on Graphics. 1987;6(3): 191-214

[7] Hakura Z, Snyder J, Lengyel J. Parameterized environment maps. In: Proceedings of the ACM Symposium on I3D; 2001. pp. 203-208

[8] G'enevaux O, Larue F, Dischler J. Interactive refraction on complex static geometry using spherical harmonics. In: Proceedings of the ACM Symposium on I3D; 2006. pp. 145-152

[9] Ofek E, Rappoport A. Interactive reflections on curved objects. In: Proceedings of the ACM SIGGRAPH; 1998. pp. 333-342

[10] Iwasaki K, Dobashi Y, Nishita T. A fast rendering method for refractive and reflective caustics due to water surfaces. In: Proceedings of Computer Graphics Forum. 2003;22(3):601-609

[11] Wang W, Wang L, Lin S, Wang J, Guo B. Real-time environment map interpolation. In: Proceedings of the 3rd International Conference on Image and Graphics; 2004. pp. 382-389

[12] Wyman C. Interactive image-space refraction of nearby geometry. In: Proceedings of the 3rd International Conference on Computer Graphics and Interactive Technique in Australasia and South Asia; 2005. pp. 205-211

[13] Hu W, Qin K. Interactive approximate rendering of reflections, refractions, and caustics. IEEE Transactions on Visualization and Computer Graphics. 2007;13(1):46-57

[14] Oliveira M, Brauwers M. Real-time refraction through deformable objects. In: Proceedings of the 2007 Symposium on Interactive 3D Graphics; 2007. pp. 89-96

[15] Rodgman D, Chen M. Refraction in volume graphics. Graphical Models. 2006;68:432-450

[16] Rousiers C, Bousseau A, Subr K, Holzchuch N, Ramamoorthi R. Realtime rendering of rough refraction. IEEE Transactions on Visualization and Computer Graphics. 2012;18(10): 1591-1602

[17] Chen Z, Wong KK. Depth from refraction using a transparent medium with unknown pose and refractive index. International Journal of Computer Vision. 2013;102(1–3):3-17

[18] Mukai N, Makino Y, Chang Y. Ray tracing based fast refraction method for an object seen through a cylindrical glass. In: Proceedings of MODSIM; 2013. pp. 747-753

[19] Mukai N, Kumagai K, Chang Y. Analytical method for generating images reflected on a cubed glass. In: Proceedings of NICOGRAPH International; 2016. pp. 178-181

**45**

**Chapter 4**

Data

**Abstract**

higher dimensions.

**1. Introduction**

Reeb skeleton, scalar data

*and Simon J. Hands*

Topological Visualisation

*Dean P. Thomas, Rita Borgo, Robert S. Laramee*

Techniques for Volume Multifield

This survey paper provides an overview of topological visualisation techniques

for scalar data sets. Topological algorithms are used to reduce scalar fields to a skeleton by mapping critical changes in the topology to the vertices of graph structures. These can be visualised using graph drawing techniques or used as a method of seeding meshes of distinct objects existing in the data. Many techniques are discussed in detail, beginning with a review of algorithms working on scalar fields defined with a single variable, and then generalised to multivariate and temporal data. The survey is completed with a discussion of methods of presenting data in

**Keywords:** indirect volume rendering, topology driven visualisation,

various purposes, and remains an active field of study [5].

multivariate visualisation, contour tree, Reeb graph, Reeb space, joint contour net,

The Marching Cubes (MC) algorithm [1] is a long established method used in indirect visualisation for creating mathematical models of data existing in a scalar field. Early research centred upon improvements for the presentation of data from medical sources such as CT and MRI scans. Whilst well suited for approximating isosurfaces on smooth functions, MC derived algorithms typically struggle to accurately capture features such as sharp edges and corners. These features can often to lead to poorly shaped triangles. Various approaches have been suggested for correcting these limitations including *Extended Marching Cubes* [2], *Dual Marching Cubes* [3], and *Cube Merging* [4]. The algorithm continues to be refined and improved for

Besides improvements to model quality, a recurring theme in research linked to the algorithm is identifying and solving topological ambiguities in the models it creates. Typical ambiguities result in the absence of triangles between two surfaces existing in opposing corners of a MC cell. This can lead to creation of a model which contains two separate objects, when in reality the model should be a single joined object. Many approaches have been suggested for overcoming these ambiguities including the use of Marching Tetrahedra [6]. The use of topological algorithms removes the possibility for ambiguities, whilst providing a method for

## **Chapter 4**

[19] Mukai N, Kumagai K, Chang Y. Analytical method for generating images reflected on a cubed glass. In:

Proceedings of NICOGRAPH International; 2016. pp. 178-181

Computer Graphics and Imaging

44
