static public synchronized void drawSolid(Graphics g)
    {
        /*for (int i=0;i<objc;i++)
        {
            if (!obj[i].noshow)
                obj[i].sortPlanes();
        }

        sortObjects();
        for (int i=0;i<objc;i++)
        {
            if (!obj[i].noshow)
                obj[i].drawSolid(g);
        }*/
        int planesToDraw=0;
        int planesDrawn=0;
        for (int i=0;i<objc;i++)
        {
            if (!obj[i].noshow)
            {
                obj[i].sortPlanes();
                planesToDraw+=obj[i].hpc;
            }
        }
        int[] objPlaneIndices=new int[objc];


        while(planesDrawn<planesToDraw)
        {
            double maxDepth=0;
            int maxDepthObjIdx=-1;
            int maxDepthPlaneIdx=-1;
            for (int i=0;i<objc;i++)
            {
                int j=objPlaneIndices[i];
                if (!obj[i].noshow && j<obj[i].hpc)
                {
                    if(obj[i].hplist[obj[i].hindex[j]].depth>maxDepth)
                    {
                        maxDepth=obj[i].hplist[obj[i].hindex[j]].depth;
                        maxDepthObjIdx=i;
                        maxDepthPlaneIdx=j;
                    }
                }
            }
            if(maxDepthObjIdx>-1 && maxDepthPlaneIdx>-1)
            {
                obj[maxDepthObjIdx].drawSolid(g, maxDepthPlaneIdx);
                objPlaneIndices[maxDepthObjIdx]++;
                planesDrawn++;
            }
            else
                break;
        }
    }