j3d.utils
Class Utils
java.lang.Object
j3d.utils.Utils
public final class Utils
- extends java.lang.Object
Constructor Summary |
Utils()
|
Method Summary |
static void |
addKeyboardNavigation(javax.media.j3d.TransformGroup tg,
javax.media.j3d.BranchGroup bg)
|
static void |
addLights(javax.media.j3d.BoundingSphere bounds1,
javax.media.j3d.BranchGroup b)
This adds some lights to the content branch of the scene graph. |
static void |
addLights(javax.media.j3d.BranchGroup bg)
|
static void |
addMotion(javax.media.j3d.Alpha a,
javax.media.j3d.TransformGroup objectsXformGroup,
javax.media.j3d.BranchGroup theBgToMove)
|
static boolean |
checkImagesDirectory()
|
static void |
checkJava3d()
|
static com.sun.j3d.utils.geometry.Primitive |
cone(java.lang.String name,
float base,
float height)
|
static javax.media.j3d.DirectionalLight |
directionalLight(java.lang.String name,
javax.vecmath.Color3f c,
javax.vecmath.Vector3f direction,
javax.media.j3d.BoundingSphere bounds)
|
static javax.media.j3d.Appearance |
getAppearance(java.awt.Component c)
|
static javax.media.j3d.BranchGroup |
getAxes(double radius)
|
static javax.media.j3d.Background |
getBackground(javax.vecmath.Color3f c)
|
static javax.media.j3d.Background |
getBackground(javax.vecmath.Color3f c,
javax.media.j3d.BranchGroup bg,
javax.media.j3d.BoundingSphere bounds)
|
static javax.media.j3d.BranchGroup |
getBranchGroup()
|
static javax.media.j3d.Canvas3D |
getCanvas3D(java.awt.Container c)
SetLayout to border layout and |
static javax.media.j3d.PolygonAttributes |
getDefaultPolygonAttributes()
|
static void |
getDirectionLight(javax.media.j3d.BoundingSphere bounds,
javax.media.j3d.BranchGroup objRoot)
|
static javax.media.j3d.Appearance |
getImageApperance(java.awt.Image image)
|
static javax.media.j3d.Background |
getImageBackground(java.lang.String fileName)
|
static javax.media.j3d.Appearance |
getMandelAppearance(int w,
int h)
|
static javax.media.j3d.Background |
getMandleBackground(int w,
int h)
|
static javax.media.j3d.Texture |
getMandleTexture(int w,
int h)
|
static com.sun.j3d.loaders.Scene |
getRemoteScene(java.net.InetAddress ia,
java.lang.String fn)
|
static com.sun.j3d.loaders.Scene |
getScene(java.io.File fqfn)
|
static com.sun.j3d.loaders.Scene |
getScene(java.lang.String fn)
|
static javax.media.j3d.Appearance |
getSkyAppearance(int i)
|
static com.sun.j3d.utils.geometry.Primitive |
getSphere()
|
static javax.media.j3d.Texture |
getTexture(java.awt.Component c)
|
static javax.media.j3d.Texture |
getTexture(java.io.File f)
|
static javax.media.j3d.Texture |
getTexture(java.awt.Image img)
|
static javax.media.j3d.BranchGroup |
getTextureSphere(double scale,
double xpos,
double ypos,
java.io.File f)
|
static javax.media.j3d.BranchGroup |
getTextureSphere(double scale,
double xpos,
double ypos,
java.awt.Image image)
|
static javax.media.j3d.Group |
getTheSphere(javax.media.j3d.Appearance app,
double scale,
double xpos,
double ypos)
|
static javax.media.j3d.TransformGroup |
getTransformGroup()
|
static javax.media.j3d.TransformGroup |
getTransformGroup(javax.media.j3d.Transform3D t3d)
|
static javax.media.j3d.ViewPlatform |
getViewPlatform()
|
static boolean |
isJava3dInstalled()
|
static boolean |
isJava3dLoaded()
|
static javax.media.j3d.Shape3D |
line(java.lang.String name,
javax.vecmath.Point3d start,
javax.vecmath.Point3d end,
javax.vecmath.Color3f color1,
javax.vecmath.Color3f color2)
|
static void |
main(java.lang.String[] args)
|
static javax.media.j3d.BranchGroup |
makePickable(java.lang.String name,
javax.media.j3d.Node node,
com.sun.j3d.utils.universe.SimpleUniverse u,
double radius)
|
static javax.media.j3d.BranchGroup |
newBranchGroup(java.lang.String name)
|
static javax.media.j3d.BranchGroup |
newBranchGroup(java.lang.String name,
javax.media.j3d.Node n)
|
static void |
printBranchGroups(com.sun.j3d.utils.universe.SimpleUniverse u)
|
static void |
printChildren(java.lang.String indent,
java.util.Enumeration branchGraphs)
|
static void |
printChildren(java.lang.String indent,
javax.media.j3d.Group bg)
|
static void |
propertiesTest(java.lang.String[] args)
|
static javax.media.j3d.Shape3D |
text3D(java.lang.String text,
java.lang.String fontName,
int style,
int size,
javax.vecmath.Color3f color,
javax.vecmath.Point3f point)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
checkJava3d
public static void checkJava3d()
getScene
public static com.sun.j3d.loaders.Scene getScene(java.lang.String fn)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
getRemoteScene
public static com.sun.j3d.loaders.Scene getRemoteScene(java.net.InetAddress ia,
java.lang.String fn)
throws java.io.FileNotFoundException,
java.net.MalformedURLException
- Throws:
java.io.FileNotFoundException
java.net.MalformedURLException
getScene
public static com.sun.j3d.loaders.Scene getScene(java.io.File fqfn)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
isJava3dInstalled
public static boolean isJava3dInstalled()
checkImagesDirectory
public static boolean checkImagesDirectory()
getTexture
public static javax.media.j3d.Texture getTexture(java.awt.Component c)
getAppearance
public static javax.media.j3d.Appearance getAppearance(java.awt.Component c)
getMandleTexture
public static javax.media.j3d.Texture getMandleTexture(int w,
int h)
getTexture
public static javax.media.j3d.Texture getTexture(java.awt.Image img)
getMandleBackground
public static javax.media.j3d.Background getMandleBackground(int w,
int h)
addKeyboardNavigation
public static void addKeyboardNavigation(javax.media.j3d.TransformGroup tg,
javax.media.j3d.BranchGroup bg)
getCanvas3D
public static javax.media.j3d.Canvas3D getCanvas3D(java.awt.Container c)
- SetLayout to border layout and
- Returns:
- a Canvas3D based on the container
addLights
public static void addLights(javax.media.j3d.BranchGroup bg)
addLights
public static void addLights(javax.media.j3d.BoundingSphere bounds1,
javax.media.j3d.BranchGroup b)
- This adds some lights to the content branch of the scene graph.
- Parameters:
b
- The BranchGroup to add the lights to.
getImageBackground
public static javax.media.j3d.Background getImageBackground(java.lang.String fileName)
getImageApperance
public static javax.media.j3d.Appearance getImageApperance(java.awt.Image image)
getTextureSphere
public static javax.media.j3d.BranchGroup getTextureSphere(double scale,
double xpos,
double ypos,
java.awt.Image image)
getDirectionLight
public static void getDirectionLight(javax.media.j3d.BoundingSphere bounds,
javax.media.j3d.BranchGroup objRoot)
getSphere
public static com.sun.j3d.utils.geometry.Primitive getSphere()
getTheSphere
public static javax.media.j3d.Group getTheSphere(javax.media.j3d.Appearance app,
double scale,
double xpos,
double ypos)
getTransformGroup
public static javax.media.j3d.TransformGroup getTransformGroup(javax.media.j3d.Transform3D t3d)
getTextureSphere
public static javax.media.j3d.BranchGroup getTextureSphere(double scale,
double xpos,
double ypos,
java.io.File f)
addMotion
public static void addMotion(javax.media.j3d.Alpha a,
javax.media.j3d.TransformGroup objectsXformGroup,
javax.media.j3d.BranchGroup theBgToMove)
getBranchGroup
public static javax.media.j3d.BranchGroup getBranchGroup()
getViewPlatform
public static javax.media.j3d.ViewPlatform getViewPlatform()
getTransformGroup
public static javax.media.j3d.TransformGroup getTransformGroup()
getTexture
public static javax.media.j3d.Texture getTexture(java.io.File f)
getMandelAppearance
public static javax.media.j3d.Appearance getMandelAppearance(int w,
int h)
isJava3dLoaded
public static boolean isJava3dLoaded()
propertiesTest
public static void propertiesTest(java.lang.String[] args)
getDefaultPolygonAttributes
public static javax.media.j3d.PolygonAttributes getDefaultPolygonAttributes()
printChildren
public static void printChildren(java.lang.String indent,
javax.media.j3d.Group bg)
text3D
public static javax.media.j3d.Shape3D text3D(java.lang.String text,
java.lang.String fontName,
int style,
int size,
javax.vecmath.Color3f color,
javax.vecmath.Point3f point)
printChildren
public static void printChildren(java.lang.String indent,
java.util.Enumeration branchGraphs)
newBranchGroup
public static javax.media.j3d.BranchGroup newBranchGroup(java.lang.String name)
newBranchGroup
public static javax.media.j3d.BranchGroup newBranchGroup(java.lang.String name,
javax.media.j3d.Node n)
printBranchGroups
public static void printBranchGroups(com.sun.j3d.utils.universe.SimpleUniverse u)
makePickable
public static javax.media.j3d.BranchGroup makePickable(java.lang.String name,
javax.media.j3d.Node node,
com.sun.j3d.utils.universe.SimpleUniverse u,
double radius)
line
public static javax.media.j3d.Shape3D line(java.lang.String name,
javax.vecmath.Point3d start,
javax.vecmath.Point3d end,
javax.vecmath.Color3f color1,
javax.vecmath.Color3f color2)
directionalLight
public static javax.media.j3d.DirectionalLight directionalLight(java.lang.String name,
javax.vecmath.Color3f c,
javax.vecmath.Vector3f direction,
javax.media.j3d.BoundingSphere bounds)
cone
public static com.sun.j3d.utils.geometry.Primitive cone(java.lang.String name,
float base,
float height)
getBackground
public static javax.media.j3d.Background getBackground(javax.vecmath.Color3f c)
getBackground
public static javax.media.j3d.Background getBackground(javax.vecmath.Color3f c,
javax.media.j3d.BranchGroup bg,
javax.media.j3d.BoundingSphere bounds)
getAxes
public static javax.media.j3d.BranchGroup getAxes(double radius)
main
public static void main(java.lang.String[] args)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
getSkyAppearance
public static javax.media.j3d.Appearance getSkyAppearance(int i)