jPCT - a 3d engine for Java > Bugs
Bilboarding when object has parent
Klaudiusz:
Something wrong. It goes crazy when parent object is moving (translated).
See attached example:
--- Code: ---import java.awt.Color;
import com.threed.jpct.*;
public class TestBB {
public static void main(String[] args) {
World w = new World();
FrameBuffer fb = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_GL_AA_2X);
fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);
fb.enableRenderer(IRenderer.RENDERER_OPENGL);
Object3D Toy= Primitives.getCube(10);
TextureManager tm = TextureManager.getInstance();
Texture vt = new Texture("blue067.jpg");
tm.addTexture("uv", vt);
TextureInfo ti=new TextureInfo(tm.getTextureID("uv"));
Toy.calcTextureWrapSpherical();
Toy.setTexture(ti);
Object3D Toy2=Toy.cloneObject();
Toy2.translate(35, 0, 0);
Toy.addChild(Toy2);
Toy2.setBillboarding(Object3D.BILLBOARDING_ENABLED);
w.getCamera().moveCamera(Camera.CAMERA_MOVEOUT, 200);
w.getCamera().moveCamera(Camera.CAMERA_MOVEUP, 50);
w.setAmbientLight(250, 250, 250);
Toy.build();
w.addObject(Toy);
Toy2.build();
w.addObject(Toy2);
while(!org.lwjgl.opengl.Display.isCloseRequested()) {
fb.clear(Color.PINK);
w.renderScene(fb);
w.draw(fb);
fb.update();
fb.displayGLOnly();
Toy.rotateY(-0.02f);
Toy.translate(0.01f,0,0);
try {
Thread.sleep(10);
} catch(Exception e) {}
}
fb.dispose();
}
}
--- End code ---
EgonOlsen:
I expected something to be wrong...it was just too easy... ;)
Thanks for the test case, i'll look into it.
EgonOlsen:
I've updated the release version. Please have a look at the issue again to see, if this fixes your problem.
Klaudiusz:
Works fine. Now i can do some partices magic:) Thanks!
Navigation
[0] Message Index
[*] Previous page
Go to full version