本文整理匯總了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}