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. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.