Author Topic: Bilboarding when object has parent  (Read 9968 times)

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Bilboarding when object has parent
« on: September 27, 2007, 11:28:59 am »
Hello,

Billboarding doesn't work when object has a parent. In documentation is written that object is always faced to the camera.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bilboarding when object has parent
« Reply #1 on: September 27, 2007, 05:31:14 pm »
Could be...i'll look into it.

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Re: Bilboarding when object has parent
« Reply #2 on: September 27, 2007, 07:48:13 pm »
Thanks:)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bilboarding when object has parent
« Reply #3 on: October 01, 2007, 08:32:14 pm »
Version 1.15 may fix this. Please give it a try.

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Re: Bilboarding when object has parent
« Reply #4 on: October 01, 2007, 09:36:12 pm »
Thx, i'll do this tommorow.

BTW. Maybe could You implement parent functionality also for lights and cameras? It could be usefull.

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Re: Bilboarding when object has parent
« Reply #5 on: October 02, 2007, 08:42:35 am »
Something wrong. It goes crazy when parent object is moving (translated).

See attached example:

Code: [Select]
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();

}

}

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bilboarding when object has parent
« Reply #6 on: October 02, 2007, 09:05:46 am »
I expected something to be wrong...it was just too easy... ;)
Thanks for the test case, i'll look into it.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Bilboarding when object has parent
« Reply #7 on: October 02, 2007, 05:23:33 pm »
I've updated the release version. Please have a look at the issue again to see, if this fixes your problem.

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Re: Bilboarding when object has parent
« Reply #8 on: October 03, 2007, 08:43:02 am »
Works fine. Now i can do some partices magic:) Thanks!
« Last Edit: October 03, 2007, 08:23:03 pm by Klaudiusz »