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

Pages: [1]
1
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

2
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

3
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]

4
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]

5
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

6
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

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

8
Support / Config.lightMul ?
« on: July 06, 2012, 02:31:59 pm »
Hi !

I can't find Config.lightMul. Isnt it available in jPCT-AE or where can i find it ?


Thanks and Greets
Dinin

9
Support / translate child object on global axis
« on: May 23, 2012, 07:45:20 am »
Hi !

I want to translate a childobject f.e. 50 units in global x axis.
How can i convert this to the translation of the child object, because translation of child object is done on parents coordinate system.

Thanks and greets
Dinin

10
Support / setOrientation of child Objects
« on: May 19, 2012, 07:39:50 pm »
Hi !

I'm trying to make a Object3D always facing away from Camera.
So i do:
Code: [Select]
object.SetOrientation(camera.getDirection(), camera.getUpVector())
this works fine, but when i add this object as child to a parentobject this doesn't work any more.

Any suggestions ?

thx and greeds
Dinin

11
Support / Rotate SimpleVector around arbitrary axis
« on: May 09, 2012, 03:10:57 pm »
Hi !

I want to rotate a SimpleVector around a arbitrary axis.
Matrix and Object3D has already a Rotate with a parameter SimpleVector for a arbitrary axis, but SimpleVector not.
So i tried to get Rotationmatrix from the Vector to rotate, rotate the matrix around my axis and then ...

SimpleVector has no SetRotationMatrix and so i dont know how to get the rotationmatrix back to SimpleVector.
Perhaps i can use SimpleVector.Rotate(Matrix), but for that i need a 'differenz Matrix' of the old and new (after Rotation of matrix) Matrix, and i dont know how to get.
A simple minus of the 2 Matrix did not work.

Any suggestions how to solve this ?

Thanks and greeds
Dinin

12
Support / Performance Issues
« on: April 11, 2012, 07:22:18 pm »
Hi !

I'm rendering objects with 450 faces and textures (64x64 pix).
The objects are serialized with reduced = true but without texture assigned because textures are set dynamical in runtime.
Now when amount of objects > 60 im running into performance problems (Galaxy SII).
So i looked with traceview and there i see that much cpu time goes to:
- com/threed/jpct/CompiledInstance.fill (25%)
        - com/threed/jpct/GenericContainer.add (31%)
        - java/nio/ShortToByteBufferAdapter.put (20%)

Do you have any idea what i can do to make this faster ?

thx and greets
Dinin

13
Support / setOrientation enlarges Object
« on: February 16, 2012, 08:43:28 pm »
Hy !

I try to move objects around and set their orientation to view Direction.

So i do a
Code: [Select]
object3D.translate(translateVector);and a
Code: [Select]
object3D.setOrientation(ViewDirectionVector, new SimpleVector(0,0,1f));But when i make setOrientation the object is enlarged (about 10 times larger).
This also happens if i set Orientation with fixed Vectors like:
Code: [Select]
object3D.setOrientation(new SimpleVector(1f,0,0), new SimpleVector(0,1f,0));
Also scaling the Object has no effect on this object anymore.

What i'm doing wrong ?

Thanks and greets
Dinin

Pages: [1]