⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 line1.java

📁 生成线条
💻 JAVA
字号:
import java.applet.Applet;
import java.awt.BorderLayout;
import com.sun.j3d.utils.applet.MainFrame;
import java.awt.GraphicsConfiguration;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;

public class quadShape extends Applet{
	private BranchGroup createSceneGraph(){
		BranchGroup objRoot=new BranchGroup();
		BoundingSphere bounds=new BoundingSphere(new Point3d(0.0,0.0,0.0),100.0);
		Color3f bgColor=new Color3f(1.0f,1.0f,1.0f);
		Background bg=new Background(bgColor);
		bg.setApplicationBounds(bounds);
		objRoot.addChild(bg);
		Shape3D shape =new quadShape2();
		objRoot.addChild(shape);
		objRoot.compile();
		return objRoot;
	}


	public quadShape(){
	setLayout(new BorderLayout());        
	GraphicsConfiguration config=SimpleUniverse.getPreferredConfiguration();     
	Canvas3D c = new Canvas3D(config); 
	add("Center", c);        
	BranchGroup scene = createSceneGraph();
        SimpleUniverse u = new SimpleUniverse(c);
        u.getViewingPlatform().setNominalViewingTransform();
        u.addBranchGraph(scene);    
	}    
	public static void main(String[] args) {
	        new MainFrame(new Line1(), 400,400);    
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -