very thanks for reply, it's idea works ^_^
PD: sorry my english is bad.
PD: sorry my english is bad.
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
public void onSurfaceChanged(GL10 gl, int w, int h) {
if (fb != null) {
fb.dispose();
}
fb = new FrameBuffer(gl, w, h);
if (master == null) {
texture = new Texture(BitmapHelper.rescale(
BitmapHelper.convert(getResources().getDrawable(
R.drawable.ic_launcher)), 64, 64));
TextureManager.getInstance().addTexture("texture", texture);
cube = Primitives.getCube(2);
cube.calcTextureWrapSpherical();
cube.setTexture("texture");
cube1 = Primitives.getCube(2);
cube1.calcTextureWrapSpherical();
cube1.setTexture("texture");
cube2 = Primitives.getCube(2);
cube2.calcTextureWrapSpherical();
cube2.setTexture("texture");
Camera cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(new SimpleVector(0, 0, 0));
MemoryHelper.compact();
if (master == null) {
Logger.log("Saving master Activity!");
master = BrokenStrings.this;
}
}
}
public void onDrawFrame(GL10 gl) {
if (h.mTicksElapsed + 500 >= midiFile.getTick()) {
Object3D clon1 = null;
switch ((((NoteOn) midiFile).getNoteValue() % 12) % 3) {
case 0:
//Create clon and add to world and LinkedList
clon1 = cube.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;
case 1:
//Create clon and add to world and LinkedList
clon1 = cube1.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;
case 2:
//Create clon and add to world and LinkedList
clon1 = cube2.cloneObject();
clon1.build();
clon1.setOrigin(new SimpleVector(0, -30, 10));
world.addObject(clon1);
clon1.rotateX(-10);
notes.add(clon1);
break;
}
midiFile = midi.nextOn();
}
fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();
notes2.addAll(notes);
Iterator<Object3D> i = notes2.iterator();
Object3D _it;
while (i.hasNext()) {
_it = i.next();
_it.translate(0, 0.4f, -0.3f);
if (_it.getCenter().y > -10f) {
removeNote(_it, i);
//i try to remove when the object is not visible in the smartphone
world.removeObject(_it);
}
}
notes2.addAll(notes);
notes.clear();
}
}
Page created in 0.052 seconds with 12 queries.