Appearance Is Everything : Object Model « 3D « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Collections Data Structure
8. Database SQL JDBC
9. Design Pattern
10. Development Class
11. Email
12. Event
13. File Input Output
14. Game
15. Hibernate
16. J2EE
17. J2ME
18. JDK 6
19. JSP
20. JSTL
21. Language Basics
22. Network Protocol
23. PDF RTF
24. Regular Expressions
25. Security
26. Servlets
27. Spring
28. Swing Components
29. Swing JFC
30. SWT JFace Eclipse
31. Threads
32. Tiny Application
33. Velocity
34. Web Services SOA
35. XML
Microsoft Office Word 2007 Tutorial
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java » 3D » Object ModelScreenshots 
Appearance Is Everything


/*
The Joy of Java 3D

by Greg Hopkins

Copyright Copyright 2001


*/

/*
There are many ways to change the way that objects in your scene look. You can change 
their color, how much light they reflect. You can paint them with two-dimensional images, 
or add rough textures to their surfaces. The Appearance class contains the functions for 
making these changes. This section shows you how to use these functions.

The simplest way of setting the appearance is by specifying only the color and the shading 
method. This works for setting an object to being a simple color, but to make an object 
look realistic, you need to specify how an object appears under lights. You do this by 
creating a Material.



Step                                                        Example
1. Create an object                             Sphere sphere = new Sphere();
----------------------------------------------------------------------------------
2. Create an appearance                         Appearance ap = new Appearance();
----------------------------------------------------------------------------------
3. Create a color                                Color3f col = new Color3f(0.0f, 0.0f, 1.0f);
----------------------------------------------------------------------------------
4. Create the coloring attributes               ColoringAttributes ca = new ColoringAttributes
                                                 (col, ColoringAttributes.NICEST);
----------------------------------------------------------------------------------
5. Add the attributes to the appearance         ap.setColoringAttributes(ca);
----------------------------------------------------------------------------------
6.  Set the appearance for the object             sphere.setAppearance(ap);



*/



           
       
Related examples in the same category
1. Line TypesLine Types
2. Shape: Point outlineShape: Point outline
3. Color YoyoColor Yoyo
4. Yoyo LineYoyo Line
5. The use of the GeometryInfo class and related classesThe use of the GeometryInfo class and related classes
6. Example SwitchExample Switch
7. A Morph object to animate a shape between two key shapesA Morph object to animate a shape between two key shapes
8. ExHenge - create a stone-henge like (vaguely) mysterious temple thing
9. Geometry By ReferenceGeometry By Reference
10. Stereo Girl
11. Red Green GirlRed Green Girl
12. Red Green GriffinRed Green Griffin
13. cg viewer
14. A basic hierarchical model of the top part of a human torsoA basic hierarchical model of the top part of a human torso
15. A large hollow box
16. Java 3D Box and a custom Cuboid implementationJava 3D Box and a custom Cuboid implementation
17. A simple class using the an indexed quadrilateral arrayA simple class using the an indexed quadrilateral array
18. Simple Indexed Quad NormalsSimple Indexed Quad Normals
19. Simple Indexed QuadSimple Indexed Quad
20. Twist Strip visual objectTwist Strip visual object
21. Door AppDoor App
22. ShadowApp creates a single planeShadowApp creates a single plane
23. TeapotTeapot
24. MorphingMorphing
25. VolRend
26. GouraudGouraud
27. An Object An Object
w__w_w___._j___a_va___2s.__c_om__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.