Difference between revisions of "Silhouette Edges"

From Math Images
Jump to: navigation, search
Line 33: Line 33:
 
Once you have the facet surface normal N, compute the view vector as the vector from the eyepoint to the point on the facet you used in computing the normal; this is the view vector V.  For this question we are more interested in the vector from the facet to the eyepoint, but this is simply V’= –V.  Then the surface normal points toward the eye if the angle between N and V’ is positive; this is true if the dot product  N•V’ is positive, as shown in the figure below: <br />
 
Once you have the facet surface normal N, compute the view vector as the vector from the eyepoint to the point on the facet you used in computing the normal; this is the view vector V.  For this question we are more interested in the vector from the facet to the eyepoint, but this is simply V’= –V.  Then the surface normal points toward the eye if the angle between N and V’ is positive; this is true if the dot product  N•V’ is positive, as shown in the figure below: <br />
 
[[Image:Silhouettefacing.jpg|400px|center]] <br />
 
[[Image:Silhouettefacing.jpg|400px|center]] <br />
 
+
==Example of a surface==
 
+
Consider a surface such as this trig function surface shown in the figure below, given by the formula  <math> f(x,y) = 0.3 \times \cos(x^2 +y^2 +t) </math>, with the parameter t intended to be varied continually giving an animation to the surface:<br />
 +
[[Image:Silhouettesurface.jpg|400px|center]] <br />
 +
If you use the technique of constructing a grid for the function domain, as described in the discussion of surfaces, for each facet you can identify the adjacent grid triangles and thus the adjacent facets, and so you can compute the facet surface normals from either the geometric or analytic approach, as described above. <br />
 +
==Example for an object==
 +
Building an interesting graphical object is probably not an easy job, so you might look for other sources of examples.  A good source might come from the might come from the publicly-available .obj files at sources named at
 +
::[http://www.hongkiat.com/blog/60-excellent-free-3d-model-websites/] <br />
 +
Below is an example:  the Stanford bunny from
 +
::[http://graphics.stanford.edu/~mdfisher/Data/Meshes/bunny.obj] <br />
 +
The figure shows this with silhouette edges in green on top of a very restricted lighting, so you can tell what a silhouette edge might look like.  Two other “canonical” .obj files for computer graphics, both having lots of interesting shapes, are the dragon and the happy Buddha you can find at
 +
::[http://www.d.umn.edu/~ddunham/cs5721f07/schedule/resources/lab_opengl07.html] <br />
 +
[[Image:Silhouettebunny.png|400px|center] <br />
 +
If you use a source such as the usual .obj files, you may have difficulty in figuring out which facets are adjacent to one you are considering.  However, some .obj files use triangles with adjacency rather than simple triangles.  In this case, the primitives with adjacency we described in the section on geometric primitives may help.  As described there, a triangle with adjacency actually includes six points, as described by the figure below: <br />
 +
::[[Image:Silhouettetriangles.png|200px|center]] <br />
  
 
|other=Graphics
 
|other=Graphics

Revision as of 14:25, 30 June 2011

{{Image Description |ImageName=Silhouette Edges |Image=Silhouettesurface.jpg |ImageIntro=placeholder |ImageDescElem=placeholder |ImageDesc= If you have a 3D object, either surface or solid, a silhouette edge is the collection of points where the surface normal is orthogonal to the view vector.

If the object is composed of facets, a silhouette edge is comprised of the common edges between a facet whose surface normal points toward the viewer and a facet whose surface normal points away from the viewer. This is then an algorithm for finding silhouette edges:

For every facet in the object
Compute the surface normal of the facet
If the surface normal points toward the viewer
For every edge of the facet
Identify the facet that shares this edge
Compute the surface normal for that facet
If this surface normal points away from the viewer
Add the edge to the collection of silhouette edges
endif
endfor
endif
endfor

Implementing this algorithm requires some vector arithmetic, as described in the pages on vectors and matrices. These include:

Computing the surface normal of a facet

This is discussed in the page on surface normals, but it involves the cross product of two vectors. These vectors may be

(a) two adjacent edge vectors from a facet, or
(b) two tangent vectors at a point in the facet computed by partial

derivatives.
Cross products are order-sensitive, so you need to arrange these two vectors so that the angle between the first E1 and second E2 is positive in the usual sense, that is, that the second is counterclockwise from the first. Then the surface normal to the facet is the cross product  N = E1 \times E2 . This is shown in the figure below:

Computingsurfacenormal.jpg


Determining whether a surface facet normal points toward the viewer

Once you have the facet surface normal N, compute the view vector as the vector from the eyepoint to the point on the facet you used in computing the normal; this is the view vector V. For this question we are more interested in the vector from the facet to the eyepoint, but this is simply V’= –V. Then the surface normal points toward the eye if the angle between N and V’ is positive; this is true if the dot product N•V’ is positive, as shown in the figure below:

Silhouettefacing.jpg


Example of a surface

Consider a surface such as this trig function surface shown in the figure below, given by the formula  f(x,y) = 0.3 \times \cos(x^2 +y^2 +t) , with the parameter t intended to be varied continually giving an animation to the surface:

Silhouettesurface.jpg


If you use the technique of constructing a grid for the function domain, as described in the discussion of surfaces, for each facet you can identify the adjacent grid triangles and thus the adjacent facets, and so you can compute the facet surface normals from either the geometric or analytic approach, as described above.

Example for an object

Building an interesting graphical object is probably not an easy job, so you might look for other sources of examples. A good source might come from the might come from the publicly-available .obj files at sources named at

[1]

Below is an example: the Stanford bunny from

[2]

The figure shows this with silhouette edges in green on top of a very restricted lighting, so you can tell what a silhouette edge might look like. Two other “canonical” .obj files for computer graphics, both having lots of interesting shapes, are the dragon and the happy Buddha you can find at

[3]

[[Image:Silhouettebunny.png|400px|center]
If you use a source such as the usual .obj files, you may have difficulty in figuring out which facets are adjacent to one you are considering. However, some .obj files use triangles with adjacency rather than simple triangles. In this case, the primitives with adjacency we described in the section on geometric primitives may help. As described there, a triangle with adjacency actually includes six points, as described by the figure below:

Silhouettetriangles.png

|other=Graphics |AuthorName=Steve Cunningham |Field=Geometry |WhyInteresting=placeholder |ImageRelates=placeholder |FieldLinks=placeholder |References=references |InProgress=Yes }}