Game Development Reference

In-Depth Information

start = -1;

}

else

{

// Exit if we've gone all the way around the

// polygon without finding a valid triangle.

if
(start == -1) start = p2;

else if
(p2 == start)
break
;

// Advance working set of vertices.

m2 = m1;

m1 = p1;

p1 = p2;

p2 = GetNextActive(p2, vertexCount, active);

}

}

delete
[] active;

return
(triangleCount);

}

Chapter 9 Summary

Depth Value Offset

To offset the depth of a vertex whose
z
coordinate is roughly
P
by a distance
δ
,

the

(

)

3,3 entry of the perspective projection matrix should be multiplied by 1
ε

+

,

where

2

fn

δ

ε

=−

.

(

)

f

+

nPPδ

+

z

z

Decal Application

A decal of width
w
and height
h
centered at the point
P
, having normal direction

N
and tangent direction
T
, should be clipped to the planes

w

w

left

=

TTP

,

−

⋅

right

=

−

TTP

,

+

⋅

2

2

Search Nedrilad ::

Custom Search