jPCT-AE - a 3d engine for Android > Support

Lines not drawing correctly for S2

(1/5) > >>

zammbi:
This maybe a problem of mine, but seems that the Galaxy S2 isn't drawing my lines for pitch maps.

-It draws the first part of the line but nothing else.
-It works fine on other phones around me.
-It fixes itself when I try OpenGL 1.1
-Lines are working fine on wagon wheels.
-AA on/off has no effect on this bug.

Any ideas why?

I'm going to hunt further for the cause of the bug, maybe get a test case going if needed. Annoying that it has to show up now when we have a release to give out in 2 hours  :-\

Edit:
Seems it's something to do with how close the camera is.
-Nothing to do with max polys.
-Nothing to do with clipping range.

Edit 2:

It looks like it has something to do with the pitch map grid itself. If I hide it:

--- Code: ---obj.setVisibility(Object3D.OBJ_INVISIBLE);
--- End code ---
, all things are good, but if I show it, it will break the lines(any). The grid itself is is just made up of small squares with each one having a transparent texture...

Is this some kind of JPCT bug?

This my code to create each square of the pitch map grid:


--- Code: --- private static Object3D addPlane(final String string, final String textureName, final int i, final float width, final float height, final float x, final float y, final float z, final boolean horizontal ){
final Object3D plane = GraphicsHelper.createPlane(width, height, textureName);//Primitives.getPlane(4, 2);

plane.setCulling(false);

if(horizontal){
plane.rotateX(-(float) Math.PI/2f);
}else{
plane.rotateY((float) Math.PI/2f);
}
//plane.rotateMesh();
// plane.clearTranslation();
plane.setAdditionalColor(new RGBColor(255, 255, 255));
plane.setCenter(SimpleVector.ORIGIN);
plane.translate(x+PitchMaps.xoffset, y , z + PitchMaps.PITCH_OFFSET);

// plane.translateMesh();
plane.setTransparency(5);
plane.setName(string + i);
plane.strip();
plane.build();

return plane;
}
public static Object3D createPlane(float width, float height, String texture){

SimpleVector upperLeftFront=new SimpleVector(-width/2f,-height/2f,0);
SimpleVector upperRightFront=new SimpleVector(width/2f,-height/2f,0);
SimpleVector lowerLeftFront=new SimpleVector(-width/2f, height/2f,0);
SimpleVector lowerRightFront=new SimpleVector(width/2f, height/2f,0);

int textID = TextureManager.getInstance().getTextureID(texture);

    Object3D box = new Object3D(2);
    box.addTriangle(upperLeftFront,0,0, lowerLeftFront,0,1, upperRightFront,1,0,textID);
    box.addTriangle(upperRightFront,1,0, lowerLeftFront,0,1, lowerRightFront,1,1,textID);
   
return box;
}

--- End code ---

Edit 3:
Looks like transparency is the problem, if I don't set the texture or transparency on the squares, the lines show fine.

Blah since I have no idea on fixing this further I will have to turn off OpenGL 2.0 and release it as I don't know how many other devices this will effect.

EgonOlsen:
I don't get this part:


--- Quote --- if I don't set the texture or transparency on the squares
--- End quote ---

What does "don't set the texture" means? That is has no texture (i.e. the white dummy texture) but still is set to be transparent?

zammbi:
If I change the code like so:


--- Code: --- //int textID = TextureManager.getInstance().getTextureID(texture);

    Object3D box = new Object3D(2);
    box.addTriangle(upperLeftFront,0,0, lowerLeftFront,0,1, upperRightFront,1,0);
    box.addTriangle(upperRightFront,1,0, lowerLeftFront,0,1, lowerRightFront,1,1);
--- End code ---

and remove

--- Code: ---plane.setTransparency(5);

--- End code ---

I can then see the lines correctly. Having either one messes up the lines.

EgonOlsen:
Do you have a screen shot?

zammbi:
Here is the screen shot(below) without the grid, showing both wagon wheel lines and pitch map lines.

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version