Author Topic: some camera angle some object display below ground  (Read 7711 times)

Offline kololo

  • byte
  • *
  • Posts: 4
    • View Profile
some camera angle some object display below ground
« on: May 23, 2011, 12:14:56 am »
i modify sample project of jpct and chang rock is tank , when i rotate camara to some angle the tree display below ground (look at pic rhe tree has position near redbox) how to fix it.
regard
"http://image.free.in.th/show.php?id=eb944d702cfdac2feadc5c89bd7fe0d7"  
« Last Edit: May 23, 2011, 12:22:38 am by kololo »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: some camera angle some object display below ground
« Reply #1 on: May 23, 2011, 10:16:40 am »
Forget about the emulator! Its software renderer renders all kinds of bugs. It's not usuable for actual development, get a real device and check the results again.

Offline kololo

  • byte
  • *
  • Posts: 4
    • View Profile
Re: some camera angle some object display below ground
« Reply #2 on: May 23, 2011, 11:05:10 am »
i use galaxy s to debug this resource and it display sam emulater . T-T
but it buatiful display plees help me how to fix it.

regrad.
kololo

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: some camera angle some object display below ground
« Reply #3 on: May 23, 2011, 11:39:47 am »
Is the ground plane set to be transparent (even with a very high value)?

Offline kololo

  • byte
  • *
  • Posts: 4
    • View Profile
Re: some camera angle some object display below ground
« Reply #4 on: May 23, 2011, 09:53:02 pm »
no .

i chang this code form sample code to load ground plane
Code: [Select]
plane = Loader.load3DS(res.openRawResource(R.raw.plane01),100);and make the camera flollow tank object by equation x = a+r*sin(angle of boject) : y = b+r*cos(angle of object)
Code: [Select]
cam.setPosition((float)(tankh.getTransformedCenter().x+150*Math.sin(((touchTurnA+1)/360*2*Math.PI)-Math.PI/180*5)), tankh.getTransformedCenter().y-50,
(float)(tankh.getTransformedCenter().z+150*Math.cos((((touchTurnA+1)/360)*2*Math.PI)-Math.PI/180*5)));
cam.lookAt(tankh.getTransformedCenter());
regard

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: some camera angle some object display below ground
« Reply #5 on: May 23, 2011, 11:32:01 pm »
Doesn't make much sense to me then. The GPU's zbuffer should take care of this unless the plane is transparent, which can result in sorting errors of that kind. Can you post a screen shot from the problem when running it on the Galaxy S?

Offline kololo

  • byte
  • *
  • Posts: 4
    • View Profile
Re: some camera angle some object display below ground
« Reply #6 on: May 25, 2011, 06:16:42 pm »
PIC url
http://image.free.in.th/show.php?id=59030926381294232166132ca999bd18

my camera is broken. but i use DDM capture 2 image , if you want real picture camera pless tell me.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: some camera angle some object display below ground
« Reply #7 on: May 25, 2011, 08:18:56 pm »
Strange...i have no idea what should cause this, except for:

  • The plane itself is transparent. Please double check that this is not the case. The 3ds loader loads transparency from the file, so just to be sure, do a setTransparency(-1); on the plane after loading it.
  • Config.stateOrientedSorting is set to false.
  • The sorting goes crazy...but there's no indication that this might be the case...