当前位置: 首页>>代码示例>>Java>>正文


Java Animator类代码示例

本文整理汇总了Java中com.sun.opengl.util.Animator的典型用法代码示例。如果您正苦于以下问题:Java Animator类的具体用法?Java Animator怎么用?Java Animator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Animator类属于com.sun.opengl.util包,在下文中一共展示了Animator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.sun.opengl.util.Animator; //导入依赖的package包/类
/**
 * @param args
 */
public static void main(String[] args) 
{
	Hyperbolizer h = new Hyperbolizer("Hyperbolizer");
    canvas = new GLCanvas();
    canvas.addGLEventListener(h);
    canvas.addMouseListener(h);
    canvas.addMouseMotionListener(h);
    h.add(canvas);
    h.setSize(1280, 1024);
    animator = new Animator(canvas);
    h.addWindowListener(new WindowAdapter()
    {
      public void windowClosing(WindowEvent e)
      {
        animator.stop();
        System.exit(0);
      }
    });
    h.setVisible(true);
    animator.start();
    canvas.requestFocus();
}
 
开发者ID:florentw,项目名称:java-membership-protocol,代码行数:26,代码来源:Hyperbolizer.java

示例2: init

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public void init(GLAutoDrawable drawable)
{
	this._gl = drawable.getGL();
	this._gl.glEnable(GL.GL_DEPTH_TEST);
	this._gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	NyARGLDrawUtil.setFontStyle("SansSerif",Font.BOLD,24);
	// NyARToolkitの準備
	try {
		// キャプチャ開始
		_capture.start();
	} catch (Exception e) {
		e.printStackTrace();
	}
	this._animator = new Animator(drawable);
	this._animator.start();
	return;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:18,代码来源:Test_NyARRealityGl_CreditCardDetect.java

示例3: GLCapabilities

import com.sun.opengl.util.Animator; //导入依赖的package包/类
/**
 * @param args
 */
public static void 					main(String[] args)
{
    DockingPreferences.initHeavyWeightUsage();
    DockingPreferences.setSingleHeavyWeightComponent(true);
	GLCapabilities capabs = new GLCapabilities();
	capabs.setHardwareAccelerated(true);
	capabs.setDoubleBuffered(true);
	capabs.setSampleBuffers(true);
	canvas = new GLCanvas(capabs);
	canvas.setMinimumSize(new Dimension(800,600));
	canvas.setMaximumSize(new Dimension(800,600));
	Hypership h = new Hypership("Hyperbolizer", canvas);
    h.setSize(1280, 800);
	canvas.addGLEventListener(h);
	canvas.addMouseListener(h);
	canvas.addMouseMotionListener(h);
    animator = new Animator(canvas);
    h.addWindowListener(new WindowAdapter()
    {
      public void windowClosing(WindowEvent e)
      {
        animator.stop();
        System.exit(0);
      }
    });
    h.setVisible(true);
    animator.start();
    //canvas.requestFocus();
}
 
开发者ID:florentw,项目名称:java-membership-protocol,代码行数:33,代码来源:Hypership.java

示例4: Quantum

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public Quantum( )
{
	GLCapabilities caps = new GLCapabilities();
	caps.setRedBits(8);
   	caps.setGreenBits(8);
   	caps.setBlueBits(8);
   	caps.setAlphaBits(8);
   	caps.setDepthBits(16);
   	caps.setStencilBits(8);    	
   	caps.setDoubleBuffered(true);    	
       canvas = new GLCanvas( caps );      
       canvas.addGLEventListener(this);       
            
       SoundManager.setBufferVolume( config.getVolumeSfx() );        
       setBounds( config.getX(), config.getY(), config.getWidth(), config.getHeight() );        
       setTitle("QUANTUM");        
       try {
		this.setIconImage( ImageIO.read( FileManager.readFile( "icon.png" ) ) );
	} catch (Exception e1) {
		Log.println( "[Quantum] couldn't 'load icon.png'" );
	}

       getContentPane().add(canvas,BorderLayout.CENTER);
       
       animator = new Animator( canvas );
       animator.setRunAsFastAsPossible( true );
       animator.start();               
       

       addWindowListener(new WindowAdapter()
       {
           public void windowClosing(WindowEvent e)
           {            	
           	remove(canvas);
           	animator.stop();
           	closing( );
               System.exit(0);
           }
       });
}
 
开发者ID:weimingtom,项目名称:quantum-game,代码行数:41,代码来源:Quantum.java

示例5: init

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public final void init(GLAutoDrawable drawable)
{
	try {
		GL gl=drawable.getGL();
		this.setup(gl);
		Animator animator = new Animator(drawable);
		animator.start();
		this._is_setup_done=true;
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	return;
}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:15,代码来源:GlSketch.java

示例6: init

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public void init(GLAutoDrawable drawable)
{
	_gl = drawable.getGL();
	_gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	//NyARToolkitの準備
	try {
		//キャプチャの準備
		JmfCaptureDeviceList list=new JmfCaptureDeviceList();
		_capture=list.getDevice(0);
		_capture.setCaptureFormat(SCREEN_X, SCREEN_Y, 15f);
		_capture.setOnCapture(this);
		//NyARToolkitの準備
		_ar_param = new NyARParam();
		NyARCode ar_code = new NyARCode(16, 16);
		_ar_param.loadARParamFromFile(PARAM_FILE);
		_ar_param.changeScreenSize(SCREEN_X, SCREEN_Y);
		_nya = new NyARSingleDetectMarker_Quad(_ar_param, ar_code, 80.0);
		_nya.setContinueMode(false);//ここをtrueにすると、transMatContinueモード(History計算)になります。
		ar_code.loadARPattFromFile(CARCODE_FILE);
		//NyARToolkit用の支援クラス
		_glnya = new NyARGLUtil(_gl);
		//GL対応のRGBラスタオブジェクト
		_cap_image = new GLNyARRaster_RGB(_ar_param,_capture.getCaptureFormat());
		//キャプチャ開始
		_capture.start();
	} catch (Exception e) {
		e.printStackTrace();
	}
	//カメラパラメータの計算
	_glnya.toCameraFrustumRH(_ar_param,_camera_projection);
	_animator = new Animator(drawable);

	_animator.start();

}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:36,代码来源:JavaSimpleLite_Quad.java

示例7: init

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public void init(GLAutoDrawable drawable)
{
	_gl = drawable.getGL();
	_gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	//NyARToolkitの準備
	try {
		//キャプチャの準備
		JmfCaptureDeviceList list=new JmfCaptureDeviceList();
		_capture=list.getDevice(0);
		_capture.setCaptureFormat(SCREEN_X, SCREEN_Y, 15f);
		_capture.setOnCapture(this);
		//NyARToolkitの準備
		_ar_param = new NyARParam();
		NyARCode ar_code = new NyARCode(16, 16);
		_ar_param.loadARParamFromFile(PARAM_FILE);
		_ar_param.changeScreenSize(SCREEN_X, SCREEN_Y);
		ar_code.loadARPattFromFile(CARCODE_FILE);
		//NyARToolkit用の支援クラス
		_glnya = new NyARGLUtil(_gl);
		//GL対応のRGBラスタオブジェクト
		_cap_image = new GLNyARRaster_RGB(_ar_param,_capture.getCaptureFormat());
		_nya = new NyARSingleDetectMarker_X2(_ar_param, ar_code, 80.0,this._cap_image.getBufferType());
		_nya.setContinueMode(false);//ここをtrueにすると、transMatContinueモード(History計算)になります。
		//キャプチャ開始
		_capture.start();
	} catch (Exception e) {
		e.printStackTrace();
	}
	//カメラパラメータの計算
	_glnya.toCameraFrustumRH(_ar_param,_camera_projection);
	_animator = new Animator(drawable);

	_animator.start();

}
 
开发者ID:nyatla,项目名称:NyARToolkit,代码行数:36,代码来源:JavaSimpleLite_X2.java

示例8: LocalTest

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public LocalTest( )
{		
	sim = new Simulation( true );
	
	for( int i = 0; i < 10; i++ )
	{
		Planet planet = new Planet( sim, new Vector2D( (float)Math.random() * 20000, (float)Math.random() *20000 ), 100,  1, 1, 1, 200 );
		planet.setOwner( 1 );
		sim.addObject( planet );			
		planet.spawnTree();
		planet.spawnTree();
		for( int j = 0; j < 100; j++ )
			planet.spawnCreature();
	}						
	
	GLCapabilities caps = new GLCapabilities();
	caps.setRedBits(8);
   	caps.setGreenBits(8);
   	caps.setBlueBits(8);
   	caps.setAlphaBits(8);
   	caps.setDepthBits(16);
   	caps.setStencilBits(8);
   	caps.setNumSamples( 8 );    	
   	caps.setDoubleBuffered(true);
       GLCanvas canvas = new GLCanvas( caps );      
       canvas.addGLEventListener(this);

       setSize(1024,1024);
       setTitle("CAV-Projekt: JOGL - Beispielszene");        

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

       final Animator animator = new Animator( canvas );
       animator.setRunAsFastAsPossible( true );
       animator.start();
       
       addWindowListener(new WindowAdapter()
       {
           public void windowClosing(WindowEvent e)
           {
           	animator.stop();            	
               System.exit(0);
           }
       });               
}
 
开发者ID:weimingtom,项目名称:quantum-game,代码行数:46,代码来源:LocalTest.java

示例9: main

import com.sun.opengl.util.Animator; //导入依赖的package包/类
public static void main(String[] args) {

		
		props = new java.util.Properties();
        try {
            java.io.File propfile = new java.io.File( "VisualFirewall.properties" );
            if ( propfile.exists() )
                props.load( new java.io.FileInputStream( propfile ) );
            else {
            		System.err.println("Properties file not found.");
            		System.exit(-1);
            }
        	
        } catch ( Exception e ) {
            e.printStackTrace();
            System.exit( -1 );
        }

       
		VisualFirewall visFW =  new VisualFirewall();
		visFW.setSize(850, 728);
		visFW.centerWindow(visFW);
		visFW.setResizable(false);
		visFW.setVisible(true);
		
		try
		{
            Thread.sleep(2000); 
        }
		catch (InterruptedException ie) {}
		
		
		Animator animator1 = new Animator((GLAutoDrawable)visFW.views[VISUAL_SIGNATURE].getGLCanvas() );
		animator1.start();
		
		Animator animator2 = new Animator((GLAutoDrawable)visFW.views[PONG].getGLCanvas() );
		animator2.start();
		
		Animator animator3 = new Animator((GLAutoDrawable)visFW.views[IDS].getGLCanvas() );
		animator3.start();
		
		new Thread(visFW.snortLog).start();
		new Thread(visFW.ipTablesLog).start();		 
	}
 
开发者ID:chrislee35,项目名称:visualfirewall,代码行数:45,代码来源:VisualFirewall.java


注:本文中的com.sun.opengl.util.Animator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。