Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
Support / Clearing all objects upon config change
« Last post by deqleos on April 05, 2018, 04:18:13 pm »

I'm currently creating an app where a high number of objects are created and removed during the usage.
Now I want to make sure that config changes don't create weird scenarios.
The objects that I create are dependant on the lifetime of a real world object. When the real world object isn't present anymore, the on screen object also has to be removed.
Now this works perfectly fine during the usage of the app. However, when the real world object is present and a config change occurs, the objects stay on the screen and don't get deleted. The problem lays in that the world gets deleted before the app has the chance to remove the objects.
The error i get is: 
ERROR: Can't remove object #1, because it doesn't belong to this World!

TLDR: How can I delete individual objects independent of the world they are in, instead of having to call world.removeObject();
Support / Re: Need advice in my Project.
« Last post by Melssj5 on April 03, 2018, 08:19:09 pm »
while asking a new question I answered my self...

1.- doing a different Thread than the renderThread to listen to commands via tcp and make the RenderThread and the TCP Thread independent from each other.

2.-Writting the values read from the tcp connection in static variables in order to be shared between the TCPThread and the RenderThread

3.-defining a maxium steep value in order the have a smooth movement

4.-doing the movement in intervals of that maxium steep size until reaching the current value (increasing or decreaseing) and moving just one step on each RenderThread iteration
Support / Re: Need advice in my Project.
« Last post by AeroShark333 on April 01, 2018, 03:32:49 pm »
I would create a variable for the renderer and a variable for the iast value from the Arduino.
Then for every draw call: rendererVariable = 0.8f* rendererVariable + 0.2f  * arduinoValue;
So it will slowly adopt to the arduinoValue.

I'm not sure if you mean something like this...
Support / Re: Best/Fastest way to make objects visible/invisible
« Last post by AeroShark333 on April 01, 2018, 03:28:42 pm »
I thought Object3D had a method to set their visibility, not quite sure though.

Another solution could be to place the Object3D 'behind' the camera
Support / Best/Fastest way to make objects visible/invisible
« Last post by Melssj5 on April 01, 2018, 06:29:23 am »
Hi friends, I am soing an app in which I must show or hide objects from my world depending on the user input..... Actually I am doing:

1: Clean (Remove all the objects3D that chould be hidden, some of them are not even in the world)
2: Adding to the world all the objects from (1:) that have to been shown
3: build the objects
4: render the world

I am constantly receving error messages that the object didnt exists on the world when trying to remove them.....

Will this way affect performance ans estability??

Which should be the best way to show or hide objects from my world. Maybe moving them to a far position out of the camera scope instead of removing them and moving them again instead of rebuilding them??? wich other aproach should I use??
Support / Need advice in my Project.
« Last post by Melssj5 on April 01, 2018, 06:22:27 am »
Hi all friends, I am in a project and need advice.

Actually I am building a custom instrument cluster for my car, I am doing this:

I have a class MyRenderer implements GLSurfaceView.Renderer

that loops rendering the world and applying the changes on it, my arduino board reads the events on the original cluster conenctor and sends to the android app via tcp. Most of changes on the world are showing/hiding indicators (low beams, high beams, parking brake, low fuel, etc), they appear and dissapear when expected, but..... when moving the RPM and SPEED needles the move slow and its not continous.

I am sending the actual speed or rpm value from the arduino to the render thread. lets say 1000 rpms ans if the next read its 1200 rpms for a fast engine movementthe needle will JUMP from 1000 rpms to 1200 rpms but it wont move smootly, it will jump..... How can I achieve a more natural movement????

I have tested moving increasing 100 rpms on wach arduino loop, even with that small movements the jpct app wont show smooth movement, in fact I see delays between each loop.

ANy ideas???
Projects / Re: Instrument Cluster for a Muscle Car
« Last post by Melssj5 on March 31, 2018, 12:41:19 am »
Yes I am using jpct as a 2d engine.-
Projects / Re: Instrument Cluster for a Muscle Car
« Last post by AeroShark333 on March 30, 2018, 07:34:37 pm »
Looks cool! Interesting idea too, good luck! :)

I suppose it's mostly or only 2D?
Support / Re: Hello World - Demo
« Last post by EgonOlsen on March 30, 2018, 06:25:52 pm »
Looks like as if you are fiddling around with jPCT-AE related objects in a separate thread like the one that handles the touch input (for example: Adding an object on touch to the world). If that's the case: Don't do that. jPCT-AE isn't thread safe. You either have to synchronize these parts or, and IMHO better, do it in the rendering thread instead.
Support / Re: Hello World - Demo
« Last post by Varanda on March 30, 2018, 03:46:01 pm »
Thanks Egon,

It crashes in different places each time I run. If I process step by step in debugging it runs fine sometimes. It is like a thread is using something that it is not ready yet.

Once it crashed here:

03-30 13:16:28.290 4119-4140/? W/jPCT-AE: [ 1522415788290 ] - WARNING: State: 0/0/0/0/0/0/0
03-30 13:16:28.300 4119-4140/? E/AndroidRuntime: FATAL EXCEPTION: GLThread 1210
                                                 Process: com.marcelo.a3demo01, PID: 4119
                                                 java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
                                                     at com.threed.jpct.CompiledInstance._fill(
                                                     at com.threed.jpct.CompiledInstance.fill(
                                                     at com.threed.jpct.Object3DCompiler.compile(
                                                     at com.threed.jpct.World.compile(
                                                     at com.threed.jpct.World.renderScene(
                                                     at com.marcelo.a3demo01.MainActivity.onDrawFrame(
                                                     at android.opengl.GLSurfaceView$GLThread.guardedRun(
                                                     at android.opengl.GLSurfaceView$
03-30 13:16:28.407 4119-4141/? D/EGL_emulation: eglMakeCurrent: 0xa3f47c40: ver 2 0 (tinfo 0xa3f0b1b0)

    public void onDrawFrame(GL10 gl10) {
        world.renderScene(fb); // this is the line 108

Pages: 1 2 3 [4] 5 6 ... 10