本文整理汇总了Java中com.jogamp.opengl.util.Animator.setRunAsFastAsPossible方法的典型用法代码示例。如果您正苦于以下问题:Java Animator.setRunAsFastAsPossible方法的具体用法?Java Animator.setRunAsFastAsPossible怎么用?Java Animator.setRunAsFastAsPossible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.util.Animator
的用法示例。
在下文中一共展示了Animator.setRunAsFastAsPossible方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OpenGLViewer
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public OpenGLViewer (String title){
super(title);
panel = new GLJPanel();
panel.addGLEventListener(this);
panel.setPreferredSize(new Dimension(width, height));
edu.stanford.rsl.conrad.cuda.MouseControl mouseControl = new edu.stanford.rsl.conrad.cuda.MouseControl(this);
panel.addMouseMotionListener(mouseControl);
panel.addMouseWheelListener(mouseControl);
this.add(panel);
pack();
setVisible(true);
boolean animate = true;
if (animate) {
animator = new Animator(panel);
animator.setRunAsFastAsPossible(true);
animator.start();
}
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
runExit();
}
});
}
示例2: JCudaDriverVolumeRendererJOGL
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
/**
* Creates a new JCudaTextureSample that displays the given volume
* data, which has the specified size.
*
* @param volumeData The volume data
* @param sizeX The size of the data set in X direction
* @param sizeY The size of the data set in Y direction
* @param sizeZ The size of the data set in Z direction
*/
public JCudaDriverVolumeRendererJOGL(GLCapabilities capabilities,
byte volumeData[], int sizeX, int sizeY, int sizeZ)
{
this.simpleInteraction = new SimpleInteraction();
h_volume = volumeData;
volumeSize.x = sizeX;
volumeSize.y = sizeY;
volumeSize.z = sizeZ;
width = 800;
height = 800;
// Initialize the GL component
glComponent = new GLCanvas(capabilities);
glComponent.addGLEventListener(this);
// Initialize the mouse controls
MouseControl mouseControl = simpleInteraction.getMouseControl();
glComponent.addMouseMotionListener(mouseControl);
glComponent.addMouseWheelListener(mouseControl);
// Create the main frame
frame = new JFrame("JCuda 3D texture volume rendering sample");
frame.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e)
{
runExit();
}
});
frame.setLayout(new BorderLayout());
glComponent.setPreferredSize(new Dimension(width, height));
frame.add(glComponent, BorderLayout.CENTER);
frame.add(createControlPanel(), BorderLayout.SOUTH);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
// Create and start the animator
animator = new Animator(glComponent);
animator.setRunAsFastAsPossible(true);
animator.start();
}
示例3: JCudaDriverSimpleJOGL
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
/**
* Creates a new JCudaDriverSimpleJOGL.
*
* @param The JOGL OpenGL capabilities
*/
public JCudaDriverSimpleJOGL(GLCapabilities capabilities)
{
simpleInteraction = new SimpleInteraction();
// Initialize the GL component and the animator
GLCanvas glComponent = new GLCanvas(capabilities);
glComponent.setFocusable(true);
glComponent.addGLEventListener(this);
// Initialize the mouse and keyboard controls
MouseControl mouseControl = simpleInteraction.getMouseControl();
glComponent.addMouseMotionListener(mouseControl);
glComponent.addMouseWheelListener(mouseControl);
KeyboardControl keyboardControl = new KeyboardControl();
glComponent.addKeyListener(keyboardControl);
// Create the main frame
frame = new JFrame("JCuda / JOGL interaction sample");
frame.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e)
{
runExit();
}
});
frame.setLayout(new BorderLayout());
glComponent.setPreferredSize(new Dimension(800, 800));
frame.add(glComponent, BorderLayout.CENTER);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
glComponent.requestFocus();
// Create and start the animator
animator = new Animator(glComponent);
animator.setRunAsFastAsPossible(false);
animator.start();
}
示例4: start
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public void start(){
// Initialize the GL component
glComponentL = new GLJPanel();
glComponentL.addGLEventListener(this);
if (stereoMode)
{
glComponentR = new GLJPanel();
glComponentR.addGLEventListener(this);
}
// Initialize the mouse controls
MouseControl mouseControl = new MouseControl(this);
glComponentL.addMouseMotionListener(mouseControl);
glComponentL.addMouseWheelListener(mouseControl);
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
runExit();
}
});
frame.setLayout(new BorderLayout());
glComponentL.setPreferredSize(new Dimension(width, height));
JPanel p = new JPanel(new GridLayout(1,1));
p.add(glComponentL);
if (stereoMode)
{
p.setLayout(new GridLayout(1,2));
p.add(glComponentR);
}
frame.add(p, BorderLayout.CENTER);
frame.add(createControlPanel(), BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
// Create and start the animator
boolean animate = true;
if (animate) {
animatorL = new Animator(glComponentL);
animatorL.setRunAsFastAsPossible(true);
animatorL.start();
if (stereoMode)
{
animatorR = new Animator(glComponentR);
animatorR.setRunAsFastAsPossible(true);
animatorR.start();
}
}
}
示例5: start
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public void start(){
// Initialize the GL component
glComponentL = new GLJPanel();
glComponentL.addGLEventListener(this);
if (stereoMode)
{
glComponentR = new GLJPanel();
glComponentR.addGLEventListener(this);
}
// Initialize the mouse controls
MouseControl mouseControl = new MouseControl(this);
glComponentL.addMouseMotionListener(mouseControl);
glComponentL.addMouseWheelListener(mouseControl);
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
runExit();
}
});
frame.setLayout(new BorderLayout());
glComponentL.setPreferredSize(new Dimension(width, height));
JPanel p = new JPanel(new GridLayout(1,1));
p.add(glComponentL);
if (stereoMode)
{
p.setLayout(new GridLayout(1,2));
p.add(glComponentR);
}
frame.add(p, BorderLayout.CENTER);
frame.add(this.createControlPanel(), BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
// Create and start the animator
boolean animate = true;
if (animate) {
animatorL = new Animator(glComponentL);
animatorL.setRunAsFastAsPossible(true);
animatorL.start();
if (stereoMode)
{
animatorR = new Animator(glComponentR);
animatorR.setRunAsFastAsPossible(true);
animatorR.start();
}
}
}
示例6: initGL
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
private void initGL() {
GLProfile gLProfile = GLProfile.getDefault();
GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);
glWindow = GLWindow.create(gLCapabilities);
newtCanvasAWT = new NewtCanvasAWT(glWindow);
glWindow.setSize(imageWidth, imageHeight);
glWindow.addGLEventListener(this);
Animator animator = new Animator(glWindow);
animator.setRunAsFastAsPossible(true);
animator.start();
}
示例7: initGL
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
private void initGL() {
GLProfile gLProfile = GLProfile.getDefault();
GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);
glWindow = GLWindow.create(gLCapabilities);
newtCanvasAWT = new NewtCanvasAWT(glWindow);
glWindow.setSize(imageWidth, imageHeight);
glWindow.addGLEventListener(this);
animator = new Animator(glWindow);
animator.setRunAsFastAsPossible(true);
animator.start();
Vec3 cameraPos = new Vec3(0f, 0f, -3f);
Quat quat = new Quat(0f, 0f, 0f, 1f);
viewPole = new ViewPole(new ViewData(cameraPos, quat, 10f), new ViewScale(90f/250f, 0.2f));
}
示例8: initGL
import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
private void initGL() {
GLProfile gLProfile = GLProfile.getDefault();
GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);
glWindow = GLWindow.create(gLCapabilities);
newtCanvasAWT = new NewtCanvasAWT(glWindow);
glWindow.setSize(imageWidth, imageHeight);
glWindow.addGLEventListener(this);
animator = new Animator(glWindow);
animator.setRunAsFastAsPossible(true);
animator.start();
}