some camera angle some object display below ground

Started by kololo, May 23, 2011, 12:14:56 AM

Previous topic - Next topic

kololo

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"  

EgonOlsen

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.

kololo

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

EgonOlsen

Is the ground plane set to be transparent (even with a very high value)?

kololo

no .

i chang this code form sample code to load ground plane
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)
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

EgonOlsen

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?

kololo

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.

EgonOlsen

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...