资源简介
基于OpenGL实现的3D飞机上下左右移动 通过上下左右前后六个摄像头分别观察飞机模型
代码片段和文件信息
import java.awt.Color;
import java.awt.frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
import com.sun.opengl.util.Animator;
import com.sun.opengl.util.GLUT;
import com.sun.opengl.util.texture.Texture;
import com.sun.opengl.util.texture.TextureIO;
import Helicopter.HelicopterRotors;
import RainParticle.ParticleSystem;
import SceneGraph.CameraNode;
import SceneGraph.LightNode;
import SceneGraph.Material;
import SceneGraph.Point3D;
import SceneGraph.Scene;
import SceneGraph.Vector3D;
import SceneGraph.Camera.*;
import SceneGraph.Light.DirectionalLight;
import SceneGraph.Light.PointLight;
import SceneGraph.Model.ObjModel;
import SceneGraph.Renderables.*;
import Terrain.AbstractTerrain;
import Terrain.HeightmapTerrain;
public class Main implements GLEventListener {
private Scene scene = null;
HelicopterRotors helicopter = null;
private double lastTick;
private GLUT glut = new GLUT();
private int windowWidth;
private int windowHeight;
private CameraNode[] camera;
private AbstractTerrain terrain;
private Texture terrainTexture;
private SmallPond pond;
private LightNode light = null;
private double clock = 0.0f; // the clock ranges from 0 to 24 - denoting hour of a day
GL gl;
private ParticleSystem particleSystem;
private ObjModel model;
@Override
// called when OpenGL is initialised
public void init(GLAutoDrawable drawable) {
gl = drawable.getGL();
lastTick = System.currentTimeMillis() / 1000.0;
scene = new Scene();
glut = new GLUT();
scene.setAmbientLightColour(Color.BLACK);
Origin origin = new Origin(“Axes“ scene.getRootNode());
origin.setScale(2.0f 2.0f 2.0f);
Ground ground = new Ground(“Grid“ scene.getRootNode() 98 1 drawable);
ground.getOrientation().setPitch(90.0f);
Skybox skybox = null;
Texture[] sky = new Texture[6];
try {
sky[0]= TextureIO.newTexture(new File(“data/textures/cloudy_noon_DN.jpg“) true);
sky[1]= TextureIO.newTexture(new File(“data/textures/sky_forward.png“) true);
sky[2]= TextureIO.newTexture(new File(“data/textures/sky_right.png“) true);
sky[3]= TextureIO.newTexture(new File(“data/textures/sky_back.png“) true);
sky[4]= TextureIO.newTexture(new File(“data/textures/sky_left.png“) true);
sky[5]= TextureIO.newTexture(new File(“data/textures/sky_up.png“) true);
skybox = new Skybox(“lovely day“ scene.getRootNode() sky);
} catch (IOException e) {
throw new RuntimeException(e);
}
skybox.setScale(100.0f 100.0f 100.0f);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-06-16 17:37 A2- 14871088\
目录 0 2018-03-01 23:36 A2- 14871088\bin\
目录 0 2018-03-01 23:36 A2- 14871088\bin\RainParticle\
文件 2452 2018-03-01 23:36 A2- 14871088\bin\RainParticle\RainParticle.class
文件 2278 2018-03-01 23:36 A2- 14871088\bin\RainParticle\ParticleSystem.class
文件 804 2018-03-01 23:36 A2- 14871088\bin\Main$1.class
文件 746 2018-03-01 23:36 A2- 14871088\bin\Main$1$1.class
目录 0 2018-03-01 23:36 A2- 14871088\bin\Helicopter\
文件 10244 2018-03-01 23:36 A2- 14871088\bin\Helicopter\HelicopterRotors.class
文件 4656 2018-03-01 23:36 A2- 14871088\bin\Helicopter\HelicopterBody.class
目录 0 2018-03-01 23:36 A2- 14871088\bin\Terrain\
文件 1469 2018-03-01 23:36 A2- 14871088\bin\Terrain\HeightmapTerrain.class
文件 2796 2018-03-01 23:36 A2- 14871088\bin\Terrain\Vector.class
文件 5525 2018-03-01 23:36 A2- 14871088\bin\Terrain\AbstractTerrain.class
文件 11336 2018-03-01 23:36 A2- 14871088\bin\Main.class
目录 0 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\
文件 2162 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Scene.class
文件 1706 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Vector3D.class
目录 0 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\
文件 3574 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Skybox.class
文件 1229 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Cylinder.class
文件 1792 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Tree$Trunk.class
文件 1051 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Quadrics.class
文件 4858 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Ground.class
文件 1390 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\BallTree.class
文件 1622 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\SharpTree$SharpTreeHead.class
文件 1725 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Cube.class
文件 1108 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Sphere.class
文件 780 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Tree.class
文件 1472 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\SphereTree.class
文件 1162 2018-03-01 23:36 A2- 14871088\bin\SceneGraph\Renderables\Disc.class
............此处省略115个文件信息
相关资源
- CoreUIVue是基于Bootstrap4的免费Vue管理模
- SpringBoot+H2+mybatis-plus59130
- 登录注册界面.zip48872
- OpenGL参考手册
- 数字华容道
- SSM+Shiro+redis实现单点登陆
- jstl-api-1.2和jstl-impl-1.2
- 基于MVC模式的会员管理系统
- 国内一家大型软件公司内部的正规软
- 仿windows记事本
- Qt Creator opengl实现四元数鼠标控制轨迹
- GUI银行管理系统
- OpenGL文档,api大全,可直接查询函数
- 超市收银系统eclipse access大学课程设计
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- 模拟ATM柜员机系统--连接数据库
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- VC 天空盒(skyBox)实现(附源代码)
- A*算法的2D演示(带源码)
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- 代码审查表和代码审查实例
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 用OpenGL开发的机械臂运动仿真程序(
- 仿126 网易 163 邮箱 界面
川公网安备 51152502000135号
评论
共有 条评论