Сuriously...
Blender settings mapping:
coordinates: Generated
Projection : Cube
Blender settings mapping:
coordinates: Generated
Projection : Cube
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menupublic class OneGraphics {
private World world;
private FrameBuffer buffer;
private Object3D model;
private String[] textures = {"OrnamentBorder0196_9_S"};
//InputStream inputstream = new FileInputStream("/home/shmex/dddd.png");
public static void main(String[] args) throws Exception{
new OneGraphics().loop();
}
public OneGraphics() throws Exception {
world = new World();
world.setAmbientLight(200, 200, 200);
//загрузка текстуры
// Image image = ImageIO.read(new File("/home/***/ff.png"));
//Texture tex = new Texture(image);
TextureManager.getInstance().addTexture("trd.jpg", new Texture("/home/***/trd.jpg"));
//TextureManager.getInstance().addTexture("Wood_Che.jpg", new Texture("/home/***/Wood_Che.jpg"));
//загрузка модели
model = loadModelfrom3DS("/home/shmex/rr.3ds", 2.5f);
world.addObject(model);
world.getCamera().setPosition(-10, 10, -10);
world.getCamera().lookAt(model.getTransformedCenter());
}
private void loop() throws Exception {
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
while (!org.lwjgl.opengl.Display.isCloseRequested()) {
model.rotateX(0.01f);
buffer.clear(java.awt.Color.BLUE);
world.renderScene(buffer);
world.draw(buffer);
buffer.update();
buffer.displayGLOnly();
Thread.sleep(10);
}
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
System.exit(0);
}
private Object3D loadModelfrom3DS(String filename, float scale) {
Object3D temp = null;
Object3D[] file = Loader.load3DS(filename, scale);
if (file.length==1) {
temp=file[0];
temp.setTexture("trd.jpg");
temp.setTransparency(2);
temp.setCulling(Object3D.CULLING_DISABLED);
temp.rotateX(-(float)Math.PI/2f);
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
temp.setAdditionalColor(new Color(100,100,100));
temp.build();
}
return temp;
}
Page created in 0.027 seconds with 12 queries.