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

Pages: [1]
Bugs / Re: Null Object Ref. com.threed.jpct.Object3D.oneTextureSet
« on: December 30, 2015, 01:31:32 pm »
Thanks for the answer and it reminded me RTFM  :-X

Bugs / Null Object Ref. com.threed.jpct.Object3D.oneTextureSet
« on: December 29, 2015, 11:15:51 am »

I have been developing an application and had a bug or normal behavior?

Scenario :

I use object pooling pattern in my application, so there are around 10 prepared Object3D instance in my ArrayList.

According to data i have from server, I remove all objects from world and add some objects from my ArrayList to world.  Everything works fine but time to time, i have this error.

E/AndroidRuntime: FATAL EXCEPTION: GLThread 122452
                                                                   Process:, PID: 28259
                                                                   java.lang.NullPointerException: Attempt to read from field 'boolean com.threed.jpct.Object3D.oneTextureSet' on a null object reference
                                                                       at com.threed.jpct.GLRenderer.drawVertexArray(
                                                                       at com.threed.jpct.World.draw(
                                                                       at com.threed.jpct.World.draw(
                                                                       at android.opengl.GLSurfaceView$GLThread.guardedRun(
                                                                       at android.opengl.GLSurfaceView$

Sample Code :
Code: [Select]
ArrayList<Object3D> objects = new ArrayList<>();
    Object3D modelObject = null;
    public void addAndRemoveObjects()
        while (objects.size() > 0)

        if (modelObject == null)modelObject = Primitives.getCube(10);

        for (int i = 0; i < 5; i++)
           Object3D obj = new Object3D(modelObject);

Sample Application can be found at

Thanks for everything
Y.Selim Abidin

Pages: [1]