• 沒有找到結果。

Over a time interval

3.3 View Tests with a Line Segment

In this section, we introduce performing view tests with a view-line.

Figure 3.5: Triangle orientation determination with a view-line at a certain time.

At a certain time

At first, we perform the view test of a triangle at a certain time. Assume that there is a triangle T (v0, v1, v2), and N = (v1− v0)× (v2− v0) is the normal vector of the triangle.

In addition, q0q1is the view-line, as shown in Figure 3.5. We can choose a vertex v of the triangle T and obtain a vector v− vp, where vp is the check point on the view-line q0q1. Then, the view test is performed as follow.

V Tl = (v− vp)· N (3.3)

vp has three types according to the location of v.

1. If v ∈ R0, then vp = q0. 2. If v ∈ R1, then vp = q1.

3. If v ∈ R2, then vp = the projective point of v on the view-line q0q1.

Therefore, view tests based on the view-point model and the view-line model are different. For the view-line model, we divide space and deformable objects into three regions, and the check points are different with respect to different vertices. Hence, before performing view tests of a triangle, we determine the regions for three vertices of a triangle.

For a vertex v of the triangle T , the projective point of v on the view-line q0q1 should be vp = q0+ u× (q1− q0).

Then, we can determine the regions for the vertex v based on the value of u.

• If u < 0, then v ∈ R0.

• If u > 1, then v ∈ R1.

• If u ∈ [0, 1], then v ∈ R2.

Theorem 3. Suppose that there is a triangle T (v0, v1, v2), and N is the normal vector of the triangle. q0q1 is a fixed view-line without intersecting with the triangle. Then, for all vertices of the triangle T , the results of view tests are the same.

Proof. We prove it as follows.

• Case 1: For any two vertices, if they are in the same region, R0 or R1, then it is proved by Corollary 1.

• Case 2: For any two vertices, if they are in the same region, R2, then suppose that v0 and v1 are chosen, and v0p and v1pare the projective points of v0 and v1 on the By Corollary 1, we have the following results.

The results of A and D are the same according to the fixed point v0p. The results of B and C are the same according to the fixed point v1p. The results of A and C are the same according to the fixed point v0. The results of B and D are the same according to the fixed point v1.

Therefore, the results of V Tv0 = (v0− v0p)· N and V Tv1 = (v1− v1p)· N are the same.

• Case 3: For any two vertices, if one vertex belongs to R0 and the other belongs to R2, then suppose that v0 and v1 are chosen that v0 ∈ R0 and v1 ∈ R2, as shown in Figure 3.6. We can find a point m of the triangle that the projective point of m on the view-line q0q1 is q0. The results of V Tv0 and V Tm are the same by case1. The results of V Tm and V Tv1 are the same by case2. So, the results of V Tv0 and V Tv1 are the same.

• case4: For any two vertices, if one vertex belongs to R1, and the other belongs to R2, then the result is similar to case3.

• case5: For any two vertices, if one vertex belongs to R0 and the other belongs to R1, then suppose that v0 and v1 are chosen that v0 ∈ R0 and v1 ∈ R1, as shown in Figure 3.7. Similar to case3, we can find two points m0 and m1of the triangle that

Figure 3.6: Triangle orientation determination with a view-line at a certain time when the triangle lies in multiple regions.

Figure 3.7: Triangle orientation determination with a view-line at a certain time when the triangle lies in multiple regions.

the projective points of m0 and m1on the view-line q0q1are q0 and q1. The results of V Tv0 and V Tm0 are the same, and the results of V Tm1 and V Tv1 are the same by case1. The results of V Tm0 and V Tm1 are the same by case2. So, the results of V Tv0 and V Tv1 are the same.

According to the above results, it is proved. Hence, for all vertices of the triangle T , the results of view tests are the same.

Therefore, we can classify the type of a triangle by performing view tests with any point of the triangle according to the view-line. In addition, the chosen vertex belongs to only one region at a certain time, so view tests are performed for just one time. By Theorem 3 and Equation 3.3, we have three conclusions. For any point of a triangle T ,

• If V Tl > 0, then the triangle faces the view-line.

• If V Tl < 0, then the triangle is back to the view-line.

• If V Tl = 0, then the triangle is coplanar to the view-line.

Over a time interval

Next, we perform view tests of a triangle over a time interval [0, ∆t], where ∆t is the time step of the simulation. During the simulation, all vertices move with linear velocities within a frame. Therefore, the position of a vertex v at a certain time in [0, ∆t] should be vt= vbgn+ V t, where vbgnis the initial position of v, vtis the new position of v, V is the linear velocity of v, and t∈ [0, ∆t].

Assume that there is a triangle T (v0, v1, v2) and N = (v1 − v0)× (v2 − v0) is the normal vector of the triangle in the beginning. After the time step ∆t, the triangle moves to T(v0, v1, v2), and N is the normal vector of the triangle T. In addition, q0q1 is the view-line, as shown in Figure 3.8.

Before performing view tests of a triangle, we determine the regions that the triangle belongs to because the triangle can spread and move across multiple regions in [0, ∆t].

The regions for a triangle are determined by its three vertices. We compute the regions

Figure 3.8: Triangle orientation determination with a view-line over a time interval when the triangle moves across multiple regions.

for three vertices, then the regions for the triangle are the union of the regions for its three vertices.

Suppose that there is a vertex of the triangle, which moves from v to v in [0, ∆t].

Then, the projective points of v and v on the view-line q0q1 should be vp = q0 + ubgn× (q1−q0) and vp = q0+ uend×(q1−q0). Because the vertices move linearly, [ubgn, uend] is also linear. We can determine the regions that the vertices move across in [0, ∆t] according to the values of ubgnand uend.

Let Rv0, Rv1, and Rv2 are the regions that the three vertices v0, v1, and v2move across in [0, ∆t]. So, the regions for the triangle are Rv0∪ Rv1 ∪ Rv2. Note that the check points are different based on different vertices of the triangle. Actually, view tests are performed based on the vertices. Suppose that v is one of the vertices of the triangle T . Then, the view test is performed as follow.

V Tl(t) = v(t)· N(t) (3.4)

V Tl(t) is a cubic function in the time domain, N (t) is the time normal vector of triangle T with quadratic form in the time domain, and v(t) is a linear function in the time domain for the vector variation from the vertex to the check points in [0, ∆t]. Note that we compute v(t) separately according to the region for the vertex. For example, if a vertex v

moves from R0to R2in [0, ∆t], then the check point is variable. So, the function of vector variation from the vertex to the check point is not linear. We should compute n kinds of v(t), where n is the number of regions for the vertex in [0, ∆t].

Suppose that the velocities of vertices v0, v1, and v2 in [0, ∆t] are V0, V1, and V2. As mentioned above, the positions of v0, v1, and v2at a certain time in [0, ∆t] are

vt0 = v0+ V0· t, t ∈ [0, ∆t]

vt1 = v1+ V1· t, t ∈ [0, ∆t]

vt2 = v2+ V2· t, t ∈ [0, ∆t]

Then, v(t) and N (t) are computed as follows.

• For any vertex v, v moves across R0 or R1in [0, ∆t].

v(t) = (v− vq) + ((vt− vq)− (v − vq))

= (v− vq) + ((v + V · t − vq)− (v − vq))

= (v− vq) + ((v− vq) + V · t − (v − vq))

= (v− vq) + V · t vqis q0or q1 according to the location of v.

• For any vertex v, v moves across R2 in [0, ∆t].

v(t) = (v− vq0) + ((vt− vqt)− (v − vq0))

= (v− vq0) + ((v + V · t − vqt)− (v − vq0))

= (v− vq0) + (v− vqt) + V · t − (v − vq0)

= (v− vqt) + V · t

vq0 is the projective point of v in the beginning, and vqtis the projective point of v at a certain time in [0, ∆t].

• Let Bs = v1− v0, Bt= V1− V0, Cs= v2− v0, Ct= V2− V0 and N (t) is the time normal vector of the triangle T . q0q1is a fixed view-line without in-tersecting with and penetrating the triangle in [0, ∆t]. Then, for all vertices of the triangle T , the results of view tests are the same in [0, ∆t].

Proof. We prove it as follows.

• Case 1: For any two vertices, if they move in the same region in [0, ∆t], then the results of view tests are always the same by Theorem 3.

• Case 2: For any two vertices, if they move across multiple regions in [0, ∆t], the proof is described as follows. For example, in Figure 3.9, v0moves from R2to R0, and v1 and v2 move inside R2 in [0, ∆t]. Suppose that the triangle T moves to Tt at time t, where t ∈ [0, ∆t]. In [0, t], all vertices move in the same region and the results of view tests are the same by Theorem 3. On the other hand, in (t, ∆t], We can always find a point mtthat the projective point of mton the view-line q0q1 is q0. So, the results of view tests of v0 are equal to the point mtin (t, ∆t]. And the results of view tests of v1and v2are equal to the point mtin (t, ∆t]. Therefore, the results of view tests of v0, v1, and v2 are the same.

By Case 1 and Case 2, it is proved. Hence, for all vertices of the triangle T , the results of view tests are the same in [0, ∆t].

Therefore, we can classify the type of a triangle by performing view tests with any point of the triangle over a time interval according to the view-line. View tests are per-formed for nr times, where nr is the number of regions that the chosen vertex moves

Figure 3.9: Triangle orientation determination with a view-line over a time interval when the triangle moves across multiple regions.

across in [0, ∆t]. By Theorem 4 and Equation 3.4, we have three conclusions. Suppose that the result of view tests for a triangle T is V Tl(t) = ∪V Tli(t), where V Tli(t) are the results of view tests according to region Ri, i = 0, ..., n− 1, and 1 ≤ n ≤ 3. For any point of a triangle T in [0, ∆t],

• If ∀V Tli(t) > 0, then V Tl(t) > 0. So, the triangle faces the view-line, and it is assigned to the view set Vl+.

• If∀V Tli(t) < 0, then V Tl(t) < 0. So, the triangle is back to the view-line, and it is assigned to the view set Vl.

• If V Tli(t) contain both positive and negative values, then the triangle is coplanar to the view-line at a certain time in [0, ∆t], and it is assigned to the view set Vl0.