Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Nemetz

Pages: [1]
1
Support / Strange values in object polygons normals.
« on: August 03, 2011, 10:41:01 am »
Hi!
In your demo example, i'm trying to rotate object adround Y Axis like this:
Code: [Select]
public static final float NINETY_DEGREES = 1.570796327f;
        .....

if (touchTurn != 0) {
cube.rotateY(NINETY_DEGREES);
touchTurn = 0;
}

and trying to get nomall vector of polygon, which i'm picking:
Code: [Select]

@Override
public void collision(CollisionEvent ce) {

ce.getTargets();
int[] ids = ce.getPolygonIDs();;
for (int i = 0; i < ids.length; i++){
Logger.log("poligon id is" + ids[i]);
}
Logger.log("name of picked object are " + this.getName());
TextureBox box = (TextureBox)ce.getObject();
if (box != null){
Logger.log("Normalized X Axis" + box.getXAxis().normalize().toString());
Logger.log("Normalized Y Axis" + box.getYAxis().normalize().toString());
Logger.log("Normalized Z Axis" + box.getZAxis().normalize().toString());

Logger.log("getTransformedNormals" + box.getPolygonManager().getTransformedNormal(ids[0]).toString());


}


}

so, i have only 4 direction when i'm rotating my cube. But i reciving a lot of different values when i try getAxis, and getTranformedNormall.  Only at the first time i'm getting correct values. And i'm confused in this when i'm facing this problem.
Example:
Code: [Select]
1:
I/jPCT-AE ( 6221): Normalized X Axis(1.0,0.0,0.0)
I/jPCT-AE ( 6221): Normalized Y Axis(0.0,1.0,0.0)
I/jPCT-AE ( 6221): Normalized Z Axis(0.0,0.0,1.0)
I/jPCT-AE ( 6221): getTransformedNormals(-0.0,-0.0,-1.0)

2:
I/jPCT-AE ( 6221): Normalized X Axis(8.3051646E-7,0.0,1.0)
I/jPCT-AE ( 6221): Normalized Y Axis(0.0,1.0,-0.0)
I/jPCT-AE ( 6221): Normalized Z Axis(-1.0,0.0,8.3051646E-7)
I/jPCT-AE ( 6221): getTransformedNormals(-8.2651775E-7,-0.0,-1.0)

3:
I/jPCT-AE ( 6221): Normalized X Axis(-4.371139E-8,0.0,-1.0)
I/jPCT-AE ( 6221): Normalized Y Axis(0.0,1.0,-0.0)
I/jPCT-AE ( 6221): Normalized Z Axis(1.0,0.0,-4.371139E-8)
I/jPCT-AE ( 6221): getTransformedNormals(-6.357829E-8,-0.0,-1.0)
4:
I/jPCT-AE ( 6221): Normalized X Axis(-1.4424753E-6,0.0,-1.0)
I/jPCT-AE ( 6221): Normalized Y Axis(0.0,1.0,0.0)
I/jPCT-AE ( 6221): Normalized Z Axis(1.0,0.0,-1.4424753E-6)
I/jPCT-AE ( 6221): getTransformedNormals(-1.4623007E-6,-0.0,-1.0)
5:
I/jPCT-AE ( 6221): Normalized X Axis(-1.0,0.0,1.1364959E-6)
I/jPCT-AE ( 6221): Normalized Y Axis(-0.0,1.0,0.0)
I/jPCT-AE ( 6221): Normalized Z Axis(-1.1364959E-6,0.0,-1.0)
I/jPCT-AE ( 6221): getTransformedNormals(-1.1444092E-6,0.0,-1.0)

2
Support / Strange behavior
« on: July 18, 2011, 03:22:59 pm »
Hi!
Found some strange thing. Whean i'm creating new object with, for example size = 32 by exmaple , which Mr. Egon gave me, like this
Code: [Select]
upperLeftFront = new SimpleVector(-size, -size, -size);
upperRightFront = new SimpleVector(size, -size, -size);
and adding texture:
Code: [Select]
this.addTriangle(upperLeftBack, 0, 0, upperLeftFront, 0, 1,
upperRightBack, 1, 0, textureId, seq);
this.addTriangle(upperRightBack, 1, 0, upperLeftFront, 0, 1,
upperRightFront, 1, 1, textureId, seq);
Texture size  is 128x128
Everything is ok, looks pretty.
But whan i'm trying to make a small box (size smaler than 12), i have an exception:
Code: [Select]
[ 1310995133186 ] - ERROR: Polygon index out of range - object is too large!
I/jPCT-AE ( 4560): java.lang.RuntimeException: [ 1310995133186 ] - ERROR: Polygon index out of range - object is too large!
I/jPCT-AE ( 4560): at com.threed.jpct.Logger.log(Logger.java:189)
I/jPCT-AE ( 4560): at com.threed.jpct.Object3D.addTriangle(Object3D.java:5858)
I/jPCT-AE ( 4560): at com.threed.jpct.Object3D.addTriangle(Object3D.java:5616)
I/jPCT-AE ( 4560): at com.threed.jpct.Object3D.addTriangle(Object3D.java:5611)
I/jPCT-AE ( 4560): at com.threed.jpct.Object3D.addTriangle(Object3D.java:5580)
I/jPCT-AE ( 4560): at com.Box.addTextureDown(Box.java:127)
Do you have any suggestions?
UPD:
Trying texture size 64*54, and 32*32, and still have the same result.

3
Support / Picking question
« on: July 06, 2011, 03:15:19 pm »
Hello!
As i saw in wiki article about picking of object there are 2 ways, and for AE as i understanding what second way is more implementabe, bacause in the firts you i must use Interact2D.pickPolygon() method which excluded from AE version of JPCT.
Give me advice, please, how can i pick the polygon in AE.
Thank you.

4
Support / BloomGLProcessor support
« on: June 29, 2011, 02:36:07 pm »
Egon, will You add BloomGLProcessor implementation in jPCT-AE?

5
Support / Cube Texture Problems
« on: June 16, 2011, 03:48:59 pm »
Hi!
I'm just started with your engine, and it's great.
But a have some problem.
Cant assign a texture for each face of cube. I have 8 png files 64x64.
How can i assign this?
If a doing it like in demo example in one file, they are wraping spherical, and it looks not so good)
Tried like this one:
cube.getPolygonManager().setPolygonTexture(iterator, TextureManager.getInstance().getTextureID("texture"));
It doesnt work also.
I downloaded Alien game, but i didn't find how testure setting at the wal.
Thanks a lot!
      

Pages: [1]