アットウィキロゴ

java0822

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

public class game0822{

Color3f lightc;
Vector3f lightd;
DirectionalLight light;
BranchGroup group;

game0822(){

SimpleUniverse univ = new SimpleUniverse();
group = new BranchGroup();
group.addChild(new ColorCube(0.3));

light3d();

univ.getViewingPlatform().setNominalViewingTransform();
univ.addBranchGraph(group);
}

public static void main( String[] args ) {
new game0822();
}



void light3d(){
lightc = new Color3f(1.8f, 0.1f, 0.1f);
BoundingSphere bounds =
new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
lightd = new Vector3f(4.0f, -7.0f, -12.0f);
light= new DirectionalLight(lightc, lightd);
light.setInfluencingBounds(bounds);
group.addChild(light);
}

}
最終更新:2011年03月01日 20:21