A normal (as I understand it) is a vector at a point on a surface which is
exactly perpendicular to the surface. In most cases you will only be dealing
with normals which are located at a corner vertex of a triangle or polygon.
By knowing the vector which is perpendicular, you can calculate the angle at
which light is striking the surface to calculate specular shading, and in the
case of raytracing or reflection mapping, what is reflected.
This is of course over simplified, but should be an accurate summary.
Graphics guru's please correct me if I'm wrong, but no flames please : )
Hope this helps
Don
Thomas M Clarke wrote:
> What exactly are Normals? (I know there used to calculate which face gets
> lighting)
> And How do I define normals for example for the following TriangleArray:
>
> private static final float[] verts =
> {
> -1.0f, 0.0f, 0.0f,
> 1.0f, 0.0f, 0.0f,
> 0.0f, 1.0f, 0.5f,
>
> -1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> 0.0f, 1.0f, 0.5f,
>
> 1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> 0.0f, 1.0f, 0.5f,
>
> -1.0f, 0.0f, 0.0f,
> 1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> };
>
> (this is a shape that has four faces and makes up something like a pyramid)
> I just copy and pasted the above verts into the normal array to see what
> happened and it didnt exactly work:
>
> private static final float[] normals =
> {
> -1.0f, 0.0f, 0.0f,
> 1.0f, 0.0f, 0.0f,
> 0.0f, 1.0f, 0.5f,
>
> -1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> 0.0f, 1.0f, 0.5f,
>
> 1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> 0.0f, 1.0f, 0.5f,
>
> -1.0f, 0.0f, 0.0f,
> 1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f,
> };
>
> I then created the shape with the following code:
>
> Tarray = new TriangleArray(12, TriangleArray.COLOR_3 |
> TriangleArray.COORDINATES | TriangleArray.NORMALS);
> Tarray.setCoordinates(0, verts);
> Tarray.setNormals(0, normals);
> app = new Appearance();
> mat = new Material(aColor, eColor, dColor, sColor, shinyness);
> app.setMaterial(mat);
> shp = new Shape3D(Tarray, app);
>
> Thank you
>
> Thomas M Clarke
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".