Java Programing

December 31, 2006

Figure 2.6 MyJava3D rendering without light intensity calculations

Filed under: Java 3D Programming — webmaster @ 3:14 pm

// if we have a normal vector, compute the intensity // under the lighting if ( (geometryArray.getVertexFormat( ) GeometryArray.NORMALS) == GeometryArray.NORMALS ) { double cos_theta; double cos_alpha; double cos_beta; for( int n = 0; n 0.0 ) { cos_theta = surf_norm.dot( light ); if ( cos_theta <= 0.0 ) { intensity = (int) (lightMax * lightAmbient); } else { temp.set( surf_norm ); temp.scale( (float) cos_theta ); 21

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Java Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting