當前位置: 首頁>>代碼示例>>Java>>正文


Java FPSAnimator類代碼示例

本文整理匯總了Java中com.jogamp.opengl.util.FPSAnimator的典型用法代碼示例。如果您正苦於以下問題:Java FPSAnimator類的具體用法?Java FPSAnimator怎麽用?Java FPSAnimator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FPSAnimator類屬於com.jogamp.opengl.util包,在下文中一共展示了FPSAnimator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) // Initialisierung
{
	GL3 gl = drawable.getGL().getGL3();
	System.out.println("OpenGl Version: " + gl.glGetString(gl.GL_VERSION));
	System.out.println("Shading Language: " + gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION));
	System.out.println();
	gl.glEnable(GL3.GL_DEPTH_TEST);
	gl.glClearColor(0.2f, 0.2f, 1.0f, 1);
	int programId = MyShaders.initShaders(gl, vShader, fShader);
	mygl = new MyGLBase1(gl, programId, maxVerts);
	FPSAnimator anim = new FPSAnimator(canvas, 200, true); // Animations-Thread,
															// 200
															// Frames/sek
	anim.start();
	lorenzdynamics = new LorenzDynamics(radius);
}
 
開發者ID:Kimmig1000,項目名稱:PhysikFuerComputerspiele,代碼行數:18,代碼來源:Vectorfield.java

示例2: main

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
public static void main(String[] args) {
    GLProfile glp = GLProfile.get("GL3");

    GLCapabilities caps = new GLCapabilities(glp);

    GLWindow glWindow = GLWindow.create(caps);
    glWindow.setSize(800, 600);
    glWindow.setVisible(true);

    glWindow.addWindowListener(new WindowAdapter() {
        public void windowDestroyNotify(WindowEvent e) {
            System.exit(0);
        }
    });

    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    animator.start();
}
 
開發者ID:bensmith87,項目名稱:jogl_gradle,代碼行數:19,代碼來源:Main.java

示例3: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) // Initialisierung
{
	GL3 gl = drawable.getGL().getGL3();
	System.out.println("OpenGl Version: " + gl.glGetString(gl.GL_VERSION));
	System.out.println("Shading Language: " + gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION));
	System.out.println();
	gl.glEnable(GL3.GL_DEPTH_TEST);
	gl.glClearColor(0, 0, 1, 1);
	int programId = MyShaders.initShaders(gl, vShader, fShader);
	mygl = new MyGLBase1(gl, programId, maxVerts);
	quad = new Quader(mygl);
	rotk = new RotKoerper(mygl);

	FPSAnimator anim = new FPSAnimator(canvas, 200, true);
	anim.start();
}
 
開發者ID:Kimmig1000,項目名稱:PhysikFuerComputerspiele,代碼行數:18,代碼來源:SlerpTest.java

示例4: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) // Initialisierung
{
	GL3 gl = drawable.getGL().getGL3();
	System.out.println("OpenGl Version: " + gl.glGetString(gl.GL_VERSION));
	System.out.println("Shading Language: " + gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION));
	System.out.println();
	gl.glEnable(GL3.GL_DEPTH_TEST);
	gl.glClearColor(0.2f, 0.2f, 1.0f, 1);
	int programId = MyShaders.initShaders(gl, vShader, fShader);
	mygl = new MyGLBase1(gl, programId, maxVerts);
	FPSAnimator anim = new FPSAnimator(canvas, 200, true); // Animations-Thread,
															// 200
															// Frames/sek
	anim.start();

}
 
開發者ID:Kimmig1000,項目名稱:PhysikFuerComputerspiele,代碼行數:18,代碼來源:Lorenz.java

示例5: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) // Initialisierung
{
	GL3 gl = drawable.getGL().getGL3();
	System.out.println("OpenGl Version: " + gl.glGetString(gl.GL_VERSION));
	System.out.println("Shading Language: " + gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION));
	System.out.println();
	gl.glEnable(GL3.GL_DEPTH_TEST);
	gl.glClearColor(0, 0, 1, 1);
	int programId = MyShaders.initShaders(gl, vShader, fShader);
	mygl = new MyGLBase1(gl, programId, maxVerts);
	quad = new Quader(mygl);
	rotk = new RotKoerper(mygl);
	
	FPSAnimator anim = new FPSAnimator(canvas, 200, true);
	anim.start();
}
 
開發者ID:Kimmig1000,項目名稱:PhysikFuerComputerspiele,代碼行數:18,代碼來源:MyFirst3D.java

示例6: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) {
	GL2 gl = drawable.getGL().getGL2();
	glu = new GLU();
	
    /* select clearing color (background) color */
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
 
    /* initialize viewing values */
    gl.glMatrixMode(GL2.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
	
 // Start animator (which should be a field).
       animator = new FPSAnimator(drawable, 60);
       animator.start();
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:18,代碼來源:TestFrameComponent.java

示例7: VisualizationPanel

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
/**
 * Constructs a new visualization-panel using the specified configuration.
 *
 * @param visualization the visualization to be displayed.
 * @param config        the configuration for the visualization-panel to be created.
 */
public VisualizationPanel(Visualization visualization, VisualizerConfig config) {
    this.visualization = visualization;

    window = GLWindow.create(config.glcapabilities);
    window.addGLEventListener(visualization.getRenderContext());
    window.addMouseListener(visualization.getMouseListener());
    window.addKeyListener(visualization.getKeyController());

    animator = new FPSAnimator(window, config.fps, true);
    visualization.getRenderContext().setAnimator(animator);

    canvas = new NewtCanvasAWT(window);

    this.setLayout(new BorderLayout());
    this.add(canvas, BorderLayout.CENTER);
}
 
開發者ID:sgs-us,項目名稱:microtrafficsim,代碼行數:23,代碼來源:VisualizationPanel.java

示例8: main

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
public static void main(String[] args) {
	// getting the capabilities object of GL2 profile
	final GLProfile profile = GLProfile.get(GLProfile.GL2);
	GLCapabilities glc = new GLCapabilities(profile);
	final GLCanvas glCanvas = new GLCanvas(glc);

	GameIntro b = new GameIntro();
	glCanvas.addGLEventListener(b);
	glCanvas.setSize(1300, 800);
	// creating frame
	final JFrame frame = new JFrame("Welcome to Heavy Evil");
	// adding canvas to it
	frame.getContentPane().add(glCanvas);
	frame.setSize(frame.getContentPane().getPreferredSize());
	frame.setVisible(true);

	final FPSAnimator animator = new FPSAnimator(glCanvas, 120, true);
	animator.start();
	
	glCanvas.isDoubleBuffered();

}
 
開發者ID:GettingNifty,項目名稱:Heavy-Evil,代碼行數:23,代碼來源:GameIntro.java

示例9: main

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
/**
* @param args
*/
public static void main(String[] args) {
GLProfile.initSingleton();
GLProfile glp = GLProfile.getDefault();
GLCapabilities caps = new GLCapabilities(glp);
GLCanvas canvas = new GLCanvas(caps);

Frame frame = new Frame("Test Surface rendering in JOGL 2 using nurbs or eval-mesh");
frame.setSize(300, 300);
frame.add(canvas);
frame.setVisible(true);

// by default, an AWT Frame doesn't do anything when you click
// the close button; this bit of code will terminate the program when
// the window is asked to close
frame.addWindowListener(new WindowAdapter() {
	public void windowClosing(WindowEvent e) {
		System.exit(0);
	}
});
canvas.addGLEventListener(new SurfaceTest());
FPSAnimator animator = new FPSAnimator(canvas, 5);
//animator.add(canvas);
animator.start();
}
 
開發者ID:akmaier,項目名稱:CONRAD,代碼行數:28,代碼來源:SurfaceTest.java

示例10: main

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
public static void main(String[] args) {

		caps = new GLCapabilities(GLProfile.getGL2GL3());
		caps.setDoubleBuffered(true); // request double buffer display mode
		caps.setHardwareAccelerated(true);
		GLJPanel canvas = new GLJPanel();

		the_game myself = new the_game();
		canvas.addGLEventListener(myself);

		canvas.addKeyListener(myself);
		animator = new FPSAnimator(canvas, 60);

		JFrame frame = new JFrame("Grab Life by the Fireballs!");
		frame.setSize(width, height); // Size in pixels of the frame we draw on
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().add(canvas);
		frame.setVisible(true);
		canvas.requestFocusInWindow();
		myself.run();
	}
 
開發者ID:thomaj46,項目名稱:GraphicsGame,代碼行數:22,代碼來源:the_game.java

示例11: Scene

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
Scene(Kengine kengine){
    this.kengine = kengine;
    GLProfile glprofile = GLProfile.getDefault();
    GLCapabilities glcapabilities = new GLCapabilities( glprofile );
    canvas = new GLCanvas(glcapabilities);
    canvas.setSize(kengine.getWidth(), kengine.getHeight());
    canvas.addGLEventListener(this);
    canvas.addMouseMotionListener(mkMouseAdapter());
    canvas.addMouseListener(mkMouseAdapter());
    canvas.addKeyListener(mkKeyAdapter());
    canvas.requestFocus();

    fpsa = new FPSAnimator(canvas,60,true);
    fpsa.start();

    kengine.add(canvas);

    hideCursor();
    try {
        rob = new Robot();
    } catch (AWTException e) {
        e.printStackTrace();
    }
    mouseCenter = (int) (kengine.getHeight()*.5);
}
 
開發者ID:seemywingz,項目名稱:Kengine,代碼行數:26,代碼來源:Scene.java

示例12: MainWindow

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
public MainWindow(CSpaceViewer viewer) {
  GLProfile glp = GLProfile.get(GLProfile.GL2);
  GLCapabilities glc = new GLCapabilities(glp);
  glc.setSampleBuffers(true);
  glc.setNumSamples(8);
  glc.setDepthBits(32);
  canvas = new GLCanvas(glc);
  animator = new FPSAnimator(canvas, 60);

  toolBar = new MainToolBar(viewer);

  setTitle("Configuration Space Visualization");
  setLayout(new BorderLayout());
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  setSize(1280, 720);
  setLocationRelativeTo(null);

  getContentPane().add(toolBar, BorderLayout.SOUTH);
  getContentPane().add(canvas, BorderLayout.CENTER);

  canvas.addGLEventListener(emptyScene);
  animator.start();
}
 
開發者ID:jstoecker,項目名稱:cspace,代碼行數:24,代碼來源:MainWindow.java

示例13: Visualisation

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
public Visualisation(DataController dataController, OpenGLPanel joglPanel,
		VisControlsContainer visControlsContainer) {

	super(CreateCapabilities());

	this.setPreferredSize(new Dimension(800, 500));
	this.setSize(800, 500);
	this.setFocusable(true);

	this.addGLEventListener(this);

	dataController.addListener(this);
	this.listOfPackets = dataController.getPackets();
	this.newPackets = new ArrayList<Packet>();
	this.dataController = dataController;
	this.joglPanel = joglPanel;
	this.visControls = this.createControls();
	this.visContainer = visControlsContainer;

	// Create the timer that will keep the FPS - don't start it yet
	this.fpskeep = new FPSAnimator(this, 600);
}
 
開發者ID:ryft,項目名稱:NetVis,代碼行數:23,代碼來源:Visualisation.java

示例14: initGL

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
private static void initGL() {
	GLCanvas canvas = new GLCanvas();
	canvas.setPreferredSize(new Dimension(Constant.CANVAS_WIDTH,
			Constant.CANVAS_HEIGHT));

	JFrame frame = new JFrame();
	frame.getContentPane().add(canvas);
	frame.addWindowListener(new WindowAdapter() {
		@Override
		public void windowClosing(WindowEvent e) {
			System.exit(0);
		}
	});
	frame.setTitle(Constant.TITLE);
	frame.pack();
	frame.setVisible(true);

	canvas.addGLEventListener(new ShaderTest());

	FPSAnimator animator = new FPSAnimator(canvas, 60);
	animator.start();
}
 
開發者ID:galaxy-workstation,項目名稱:AircraftDemo,代碼行數:23,代碼來源:ShaderTest.java

示例15: init

import com.jogamp.opengl.util.FPSAnimator; //導入依賴的package包/類
@Override
public void init(GLAutoDrawable drawable) // Initialisierung
{
	GL3 gl = drawable.getGL().getGL3();
	System.out.println("OpenGl Version: " + gl.glGetString(gl.GL_VERSION));
	System.out.println("Shading Language: " + gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION));
	System.out.println();
	gl.glEnable(GL3.GL_DEPTH_TEST);
	gl.glClearColor(0, 0, 1, 1);
	int programId = MyShaders.initShaders(gl, vShader, fShader);
	mygl = new MyGLBase1(gl, programId, maxVerts);
	quad = new ModifyableQuader(mygl, 50f, 2.5f, 1f, 2f);
	quad2 = new Quader(mygl);

	double a = (quaderLength * quaderLength + quaderWidth * quaderWidth) / 12;
	double b = (quaderLength * quaderLength + quaderHeight * quaderHeight) / 12;
	double c = (quaderWidth * quaderWidth + quaderHeight * quaderHeight) / 12;
	gyro = new GyroDynamics(a, b, c);
	gyro.setState(1, 2, 4, 30, 3, 1, 2);

	gyro2 = new GyroDynamics(a, b, c);
	gyro2.setState(1, 2, 4, 30, 3, 1, 2);

	rgb = new Vec3(0, 1, 0);

	FPSAnimator anim = new FPSAnimator(canvas, 200, true);
	anim.start();
}
 
開發者ID:Kimmig1000,項目名稱:PhysikFuerComputerspiele,代碼行數:29,代碼來源:FlyingQuaders.java


注:本文中的com.jogamp.opengl.util.FPSAnimator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。