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.


Messages - Dinin

Pages: [1] 2
1
Support / Re: Processtime for renderScene and draw
« on: March 08, 2015, 09:42:36 pm »
I'm trying to create a zombie game and the objects are zombies running, attacking ... so human animation.
How much does reducing the polygons improve the performance ? It 1:1 ? so if i reduce the polygons to 1/2 is there double performance ?

2
Support / Re: Processtime for renderScene and draw
« on: March 08, 2015, 09:34:15 pm »
Yes all objects are animated.

3
Support / Processtime for renderScene and draw
« on: March 08, 2015, 03:15:53 pm »
Hi,

just a short question about processtime for world.renderScene() and world.draw().
I have a world with about 20-25 Objects with 770 Polys.
The objects are keyframe animated and the textures are 128x128.
So one renderScene takes about 6ms and world.draw takes between 30-40ms.
Is this a normal time or am i doing somithing wrong ?

I'm testing on a htc one m8.

thx
Dinin

4
Support / Re: plane as clipping plane
« on: January 16, 2014, 03:53:59 pm »
I just found the solution.
If i set a transparent texture and do not call setTransparency of plane it does exactly what i want  :).

Greetings
Dinin

5
Support / Re: plane as clipping plane
« on: January 16, 2014, 10:53:43 am »
I have a animation where a zombie is comming out of ground. So only the part above ground should be visible. The problem is that i have no groundplane in opengl, only a transparent background.

[attachment deleted by admin]

6
Support / plane as clipping plane
« on: January 15, 2014, 03:02:52 pm »
Hi !

I need a plane that is transparent (for user) but still hides objects/parts of objects. Like a plane that acts like a clipping plane. Is there any way i can do something like that ?

Thanks
Dinin

7
Support / Re: Z-Buffer Problems
« on: November 17, 2013, 03:42:33 pm »
 ::) sometimes i'm so blind .... thanks

8
Support / Re: Z-Buffer Problems
« on: November 17, 2013, 03:33:55 pm »
Yes, i,ve done:
Code: [Select]
NVDepthConfigChooser nvDepthConfigChooser = new NVDepthConfigChooser(this);
EGL10 egl = (EGL10) EGLContext.getEGL();
EGLDisplay glDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

egl.eglInitialize(glDisplay, new int[]{2,0});
eglConfig = nvDepthConfigChooser.chooseConfig(egl, glDisplay);

EGLConfigChooser myEGLConfigChooser = new EGLConfigChooser() {

@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
return eglConfig;
}
};
setEGLConfigChooser(myEGLConfigChooser);
Now it renders correct even on HTC One.
Many Thanks !

But now i'm not able to get a transparent background. Buffer.Clear with transparent color and setZOrderOnTop(true) do not work.
Do you have any idea what else i can do to get transparent background ?

9
Support / Re: Z-Buffer Problems
« on: November 17, 2013, 12:47:47 pm »
I'm using HTC One with GPU Adreno 320.

I've now tested it on a Galaxy S2 and there everything works fine ?!?

10
Support / Z-Buffer Problems
« on: November 17, 2013, 11:50:52 am »
Hi !

I have a body wearing a armor. When the camera is near, everything is fine. But if i move the camera out, the armor does not render correct. It seems to be partially behind the body.  :-[

I attached 2 screenshots showing the problem.

Setting transparency to -1 has no effect.

Any suggestions ?

Thanks and greetings
Dinin

[attachment deleted by admin]

11
Support / JPCT with Google Maps - Problem with Tilt
« on: April 21, 2013, 07:41:46 pm »
Hi !

I'm trying to use a GLSurfaceView over a MapView from Google to display 3D Objects on the map. So i calculate the coordinates from latitude and longitude and set the object in jpct world.
Also set and move the camera according to the camera of Google Maps.
Everthing (zoom, pan, rotate) is working fine if i'm looking down from straight above with tilt = 0. But if i change the viewangle/tilt then all my jpct objects (except the one in the center) are moving towards the camera in reference to the map  :-\. Attached two pics to make it clearer.

Has anyone a idea what i'm doing wrong or whats the problem, and has maybe a solution ?

Great thanks for all ideas.
Greets
Dinin

[attachment deleted by admin]

12
Support / turret aiming on target
« on: November 17, 2012, 04:09:16 pm »
Hi !

I wanted a turret (mounted on a spaceship) to aim at a target.
So i have a turretBody only rotating around y axis and a turretBarrel rotating around x axis.

I tried to do it so:
Code: [Select]
public void targetAt(){
// Targetdirection
SimpleVector directionD = target.getTransformedCenter().calcSub(turretBody.getTransformedCenter()).normalize();

//The object's initial direction
SimpleVector directionI = turretBarrel.getWorldTransformation().getYAxis().normalize();

//Axis to rotate around
SimpleVector axis = new SimpleVector( directionD.calcCross( directionI ) ).normalize();

float turnrate = .03f;
if (axis.x < 0)
turretBarrel.rotateX(-turnrate);
else
turretBarrel.rotateX(turnrate);

if (axis.z < 0)
turretBody.rotateY(-turnrate);
else
turretBody.rotateY(turnrate);
}

Works fine if ship is not rotating.
But when the ship rotates at a specific position the turret aims exactly in the direction away from target. I think because the cross product of the vectors changes direction on different angle of the vectors.
But how can i get always the right rotateaxis ?

Here the complete code with objectgeneration:
Code: [Select]
public void init(){
world.removeAll();
createObjects();
}


public void gameloop(){
targetAt();
ship.rotateX(.005f);
target.translate(1 * translatedirection,0,0);
if (Math.abs(target.getTransformedCenter().x) > 80)
translatedirection *= -1;
}

public void createObjects(){
target = Primitives.getBox(5, 3);
target.setAdditionalColor(RGBColor.BLUE);
target.translate(0,-40,0);
world.addObject(target);

ship = Primitives.getBox(7, 1);
ship.setAdditionalColor(RGBColor.WHITE);
ship.translate(50,100,0);
world.addObject(ship);

turretBody =  Primitives.getBox(3, 1);
turretBody.setAdditionalColor(RGBColor.GREEN);
turretBody.translate(0,-10,0);
world.addObject(turretBody);

turretBarrel = Primitives.getBox(1, 7);
turretBarrel.build();
turretBarrel.rotateX(Manager.degreesToRadians(180));
turretBarrel.setRotationPivot(new SimpleVector(0,-7,0));
turretBarrel.setAdditionalColor(RGBColor.RED);
turretBarrel.translate(0,5,0);
world.addObject(turretBarrel);

ship.addChild(turretBody);
turretBody.addChild(turretBarrel);
ship.rotateX(Manager.degreesToRadians(90));
}

public void targetAt(){
// Targetdirection
SimpleVector directionD = target.getTransformedCenter().calcSub(turretBody.getTransformedCenter()).normalize();

//The object's initial direction:
SimpleVector directionI = turretBarrel.getWorldTransformation().getYAxis().normalize();

//Axis to rotate around should be:
SimpleVector axis = new SimpleVector( directionD.calcCross( directionI ) ).normalize();

float turnrate = .03f;
if (axis.x < 0)
turretBarrel.rotateX(-turnrate);
else
turretBarrel.rotateX(turnrate);

if (axis.z < 0)
turretBody.rotateY(-turnrate);
else
turretBody.rotateY(turnrate);
}

Thanks for any help.
Greetings
Dinin

13
Support / enable4bpp 16bit texture in memory
« on: July 30, 2012, 08:05:58 am »
Hi !

I'm trying to reduce memory usage so i tried 'texture.enable4bpp(true)', but in log the same memory is used to load the Texture:
Texture loaded...16384 bytes/64*64 pixels!

In this thread (http://www.jpct.net/forum2/index.php/topic,1963.msg14447.html#msg14447) you wrote:
Quote
The call itself doesn't consume one single byte of memory. The conversion happens during the upload process to the GPU. The texture data in memory is always 8bpp no matter which setting you use.

So is there no way to load 16bit textures to memory ?

Greets and thx
Dinin

14
Support / Re: Semitransparent texture not working anymore
« on: July 25, 2012, 09:01:38 am »
Argh  :-[ .... Yes that's it, i forgot that i set useAlpha = false to test if i can save memory ....
Many Thanks ....

15
Support / Semitransparent texture not working anymore
« on: July 25, 2012, 08:11:10 am »
Hi !

I've a semitransparent texture (attachment) and i'm setting it on a Plane.
Code: [Select]
Object3D testplane = Primitives.getPlane(1, 50);
Manager.LoadTexture(context, "tex_laser003");
testplane.setTexture("tex_laser003");
testplane.setCulling(false);
testplane.setTransparency(10);
world.addObject(testplane);
But when rendered it shows like in attachment screen.jpg.

This did already work  (also tried in backup of my project and it worked already).
So can anyone tell me what i've done wrong or what i've changed so that this do not work anymore ?

Thx and Greets
Dinin


[attachment deleted by admin]

Pages: [1] 2