91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4.5MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-08-15
  • 語言: Java
  • 標簽: java??jogl??opengl??

資源簡介

這是一個印度的大學教授寫的,學jogl 的可以看看,很不錯。這是java 與 opengl 結合的小例子,有導入模型的。和聲音,如果不錯你就頂

資源截圖

代碼片段和文件信息


//?ModelLoaderGL.java
//?Andrew?Davison?November?2006?ad@fivedots.coe.psu.ac.th

/*?A?Jframe?contains?a?JPanel?which?holds?a?GLCanvas.?The?GLCanvas
???displays?a?loaded?OBJ?model?which?may?be?rotating.?The?model
???is?scaled?and?centered?at?the?origin.?The?scaling?is?controlled
???by?the?maxSize?value?which?specifies?the?maximum?size?of?the
???model‘s?largest?dimension.

???The?listener?for?the?canvas?is?ModelLoaderGLListener?and?the?updates
???to?the?canvas‘?display?are?triggered?by?FPSAnimator?using?
???fixed-rate?scheduling.

???The?code?uses?the?JSR-231?1.0.0?release?build?of?JOGL?
???14th?September?2006.

???Usage:
??????runGL?modelGL??[max-size]?[-nr]

???The?OBJ?name?is?assumed?to?be?for?a?file?in?the?“models/“?
???subdirectory?and?the?“.OBJ“?extension?is?added?automatically.

???If?a?“max-size“?value?is?not?specified?then?MAX_SIZE?is?used.
???“-nr“?means?“no?rotation“?so?the?default?action?is?to?rotate?the
???model.
*/

import?java.awt.BorderLayout;
import?java.awt.Container;
import?java.awt.Dimension;
import?java.awt.event.WindowAdapter;
import?java.awt.event.WindowEvent;
import?java.io.File;

import?javax.media.opengl.GLCanvas;
import?javax.swing.Jframe;
import?javax.swing.JPanel;

import?com.sun.opengl.util.FPSAnimator;


public?class?ModelLoaderGL?extends?Jframe
{
??private?static?int?DEFAULT_FPS?=?80;
??private?static?final?int?PWIDTH?=?512;???//?initial?size?of?panel
??private?static?final?int?PHEIGHT?=?512;?
??private?static?final?float?MAX_SIZE?=?4.0f;??//?for?a?model‘s?dimension

??private?ModelLoaderGLListener?listener;
??private?FPSAnimator?animator;



??public?ModelLoaderGL(String?nm?float?maxSize?boolean?doRotate)?
??{
????super(“ModelLoaderGL“);
?
????System.out.println(“Max?model?size:?“?+?maxSize);
????System.out.println(“Rotating:?“?+?doRotate);

????
????Container?c?=?getContentPane();
????c.setLayout(?new?BorderLayout()?);???
????JPanel?p?=?makeRenderPanel(nm?maxSize?doRotate);
????c.add(p?BorderLayout.CENTER);
??
????addWindowListener(?new?WindowAdapter()?{
??????public?void?windowClosing(WindowEvent?e)
??????/*?The?animator?must?be?stopped?in?a?different?thread?from
?????????the?AWT?event?queue?to?make?sure?that?it?completes?before
?????????exit?is?called.?*/
??????{?new?Thread(?new?Runnable()?{
??????????public?void?run()?{
????????????animator.stop();
????????????System.exit(0);
??????????}
????????}).start();
??????}?//?end?of?windowClosing()
????});

????pack();
????setVisible(true);

????animator.start();
??}?//?end?of?ModelLoaderGL()

??/**Construct?a?GLCanvas?in?a?JPanel?and?add?a?
??listener?and?animator.?*/
??private?JPanel?makeRenderPanel(String?nm?float?maxSize?boolean?doRotate)
?{
????JPanel?renderPane?=?new?JPanel();?
????renderPane.setLayout(?new?BorderLayout()?);
????renderPane.setOpaque(false);????
????renderPane.setPreferredSize(?new?Dimension(PWIDTH?PHEIGHT));
?
???//添加JOGL特性
????GLCanvas?canvas?=?new?GLCanvas();?
????File?filename=new?File(“../src/models/“+nm);????
????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2007-05-30?11:17??jogl2\
?????文件?????????644??2007-05-30?13:44??jogl2\.classpath
?????文件?????????381??2007-05-30?11:17??jogl2\.project
?????目錄???????????0??2007-06-14?14:13??jogl2\bin\
?????文件?????????848??2007-06-14?14:17??jogl2\bin\ModelLoaderGL$1$1.class
?????文件?????????881??2007-06-14?14:17??jogl2\bin\ModelLoaderGL$1.class
?????文件????????3371??2007-06-14?14:17??jogl2\bin\ModelLoaderGL.class
?????文件????????3439??2007-06-14?14:13??jogl2\bin\ModelLoaderGLListener.class
?????目錄???????????0??2007-06-14?14:13??jogl2\bin\models\
?????文件?????????246??2007-05-30?11:18??jogl2\bin\models\barbell.mtl
?????文件???????14326??2007-05-30?11:18??jogl2\bin\models\barbell.obj
?????文件??????307864??2007-06-14?13:57??jogl2\bin\models\beisishou2.md2
?????文件??????355326??2007-06-14?13:57??jogl2\bin\models\beisishou2.png
?????文件?????????126??2007-05-30?11:18??jogl2\bin\models\colorCube.mtl
?????文件?????????431??2007-05-30?11:18??jogl2\bin\models\colorCube.obj
?????文件??????????35??2007-05-30?11:08??jogl2\bin\models\couch.mtl
?????文件???????80177??2007-05-30?11:08??jogl2\bin\models\couch.obj
?????文件????????2781??2007-05-30?11:08??jogl2\bin\models\formula.mtl
?????文件??????709155??2007-05-30?11:08??jogl2\bin\models\formula.obj
?????文件?????????205??2007-05-30?11:18??jogl2\bin\models\heli.mtl
?????文件???????75149??2007-05-30?11:18??jogl2\bin\models\heli.obj
?????文件????????2321??2007-05-30?11:08??jogl2\bin\models\metal.jpg
?????文件??????????69??2007-05-30?11:18??jogl2\bin\models\pawn.mtl
?????文件???????22717??2007-05-30?11:18??jogl2\bin\models\pawn.obj
?????文件???????27313??2007-05-30?11:08??jogl2\bin\models\penguin.gif
?????文件?????????179??2007-05-30?11:08??jogl2\bin\models\penguin.mtl
?????文件???????14325??2007-05-30?11:08??jogl2\bin\models\penguin.obj
?????文件?????????465??2007-05-30?11:08??jogl2\bin\models\rose+vase.mtl
?????文件??????368428??2007-05-30?11:08??jogl2\bin\models\rose+vase.obj
?????目錄???????????0??2007-06-14?14:13??jogl2\bin\OBJLoader\
?????文件????????2478??2007-06-14?14:13??jogl2\bin\OBJLoader\FaceMaterials.class
............此處省略46個文件信息

評論

共有 條評論