アットウィキロゴ

pro kkkk

import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class pro{
public pro() {

SimpleUniverse univ = new SimpleUniverse();
BranchGroup gr = new BranchGroup();

Appearance ap = new Appearance( );
Material ma = new Material( );
ap.setMaterial( ma );
Cone cone = new Cone( 0.3f, 0.6f, Cone.GENERATE_NORMALS, ap );

TransformGroup tg = new TransformGroup( );
tg.addChild(cone );
gr.addChild(tg);

Color3f light1Color = new Color3f(1.8f, 0.1f, 0.1f);
BoundingSphere bounds =new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
Vector3f light1Direction = new Vector3f(4.0f, -7.0f, -12.0f);
DirectionalLight light= new DirectionalLight(light1Color, light1Direction);
light.setInfluencingBounds(bounds);
gr.addChild(light);

tg.setCapability( TransformGroup.ALLOW_TRANSFORM_WRITE );

Alpha alpha = new Alpha( );

PositionInterpolator pos = new PositionInterpolator(alpha,tg);

tg.addChild(pos );
univ.getViewingPlatform().setNominalViewingTransform();
pos.setSchedulingBounds( bounds );

univ.addBranchGraph(gr);
}

public static void main(String[] args) {
new pro();
}
}
最終更新:2010年10月04日 08:26