Thanks for your quick reply.
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 Menu
World worldx = new World();
ModelFactory modelFactory = ModelFactory.getInstance();
BaseEntity[] fields = new BaseEntity[4];
Object3D[] cruz = null;
if (SHOW_ORIGIN){
/* cruz = Loader.loadOBJ("/home/miguel/perfectday_project/TestProfectDay3D/models/xCoord.obj", "/home/miguel/perfectday_project"" /TestProfectDay3D/models/xCoord.mtl", 1.0f);*/
// cruz = Loader.load3DS("/home/miguel/perfectday_project/TestProfectDay3D/models/xCoord.3ds", 1.0f);
for (int i = 0; i < cruz.length; i++) {
worldx.addObject(cruz[i]);
}
}
worldx.buildAllObjects();
/**
* Place the camera at the starting position.
*/
Camera camera = worldx.getCamera();
camera.setPosition(this.xCamara,this.yCamara , this.zCamara);
camera.lookAt(SimpleVector.ORIGIN);
Config.fadeoutLight = false;
worldx.getLights().setOverbrightLighting(Lights.OVERBRIGHT_LIGHTING_DISABLED);
worldx.getLights().setRGBScale(Lights.RGB_SCALE_2X);
worldx.setAmbientLight(25, 30, 30);
/**
* Place the lightsources...
*/
worldx.addLight(new SimpleVector(0, -150, 0), 25, 22, 19);
worldx.addLight(new SimpleVector(-1000, -150, 1000), 22, 5, 4);
worldx.addLight(new SimpleVector(1000, -150, -1000), 4, 2, 22);
return worldx;
textureManager.addTexture("metal", new Texture(new FileInputStream("/home/miguel/perfectday_project/JPCTExm/textures/rocks.jpg")));
model = Loader.load3DS(new FileInputStream("/home/miguel/perfectday_project/blender_model/obj_export/montanya2.3ds"), 1);
Object3D field = model[0];
field.calcTextureWrap();
field.setTexture("metal");
field.setEnvmapped(Object3D.ENVMAP_DISABLED);
field.setCenter(SimpleVector.ORIGIN);
field.rotateX((float) (Math.PI /-2));
int size = (int) field.getScale();
System.out.println("SCALE:"+field.getScale());
field.setOrigin(SimpleVector.ORIGIN);
field.build();
worldx.addObject(field);
textureManager.addTexture("metal", new Texture(new FileInputStream("/home/miguel/perfectday_project/JPCTExm/textures/rocks.jpg")));
model = Loader.load3DS(new FileInputStream("/home/miguel/perfectday_project/blender_model/obj_export/montanya2.3ds"), 1);
Object3D field = model[0];
field.calcTextureWrapSpherical();
field.setTexture("metal");
field.setEnvmapped(Object3D.ENVMAP_DISABLED);
field.setCenter(SimpleVector.ORIGIN);
field.rotateX((float) (Math.PI /-2));
int size = (int) field.getScale();
System.out.println("SCALE:"+field.getScale());
field.setOrigin(SimpleVector.ORIGIN);
field.build();
worldx.addObject(field);
TextureManager textureManager = TextureManager.getInstance();
textureManager.addTexture("metal", new Texture(new FileInputStream("/home/miguel/perfectday_project/JPCTExm/textures/rocks.jpg")));
model = Loader.load3DS(new FileInputStream("/home/miguel/perfectday_project/blender_model/obj_export/plano.3ds"), 1);
Object3D field = model[0];
field.setTexture("metal");
field.setEnvmapped(Object3D.ENVMAP_DISABLED);
field.setCenter(SimpleVector.ORIGIN);
field.rotateX((float) (Math.PI /-2));
int size = (int) field.getScale();
System.out.println("SCALE:"+field.getScale());
field.translate(-field.getScale()*(1), -field.getScale()*(1), 0);
field.setOrigin(SimpleVector.ORIGIN);
field.build();
TextureManager textureManager = TextureManager.getInstance();
textureManager.addTexture("metal", new Texture(new FileInputStream("/home/miguel/perfectday_project/JPCTExm/textures/rocks.jpg")));
model = Loader.load3DS(new FileInputStream("/home/miguel/perfectday_project/blender_model/obj_export/plano.3ds"), 1);
Object3D field = model[0];
field.setTexture("metal");
Object3D plane = Primitives.getPlane(1, 4);
plane.translate(SimpleVector.ORIGIN);
plane.setTexture("metal");
plane.rotateX((float) (Math.PI /-2));
plane.setEnvmapped(Object3D.ENVMAP_DISABLED);
plane.build();
Page created in 0.020 seconds with 12 queries.