Plotting order of the half-transparent objects

5 messages
Open this post in threaded view
|

Plotting order of the half-transparent objects

 This post was updated on . Hi All, Suppose one have such code that plots 3 spheres one in another with different Alpha channel values. Everything works fine when first we plot the small object, then middle (that contains small) and then the biggest (that contains small and middle).         small = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.1,                                    colors=np.array(((0,0,0,0.9))),                                    drawstyle=1))                 middle = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.5,                                    colors=np.array(((0,0,0,0.5))),                                    drawstyle=1))                 large = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize= 1,                                    colors=np.array(((0,0,0,0.1))),                                    drawstyle=1)) However, when we shift the order of plotting, e.g., first - middle, then small and then large:         middle = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.5,                                    colors=np.array(((0,0,0,0.5))),                                    drawstyle=1))                 small = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.1,                                    colors=np.array(((0,0,0,0.9))),                                    drawstyle=1))                         large = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize= 1,                                    colors=np.array(((0,0,0,0.1))),                                    drawstyle=1)) Only two objects are visible: middle and the biggest. The smallest is not plotted. So, the small objects that lays inside large and plotted later are not showed. Is that expected behavior? Otherwise one have to care about what to plot and when,  in order to keep it all consistent. My solution was to draw spheres manually by combining surfaces, but its getting extremely slow and inefficient. Thank you! Best regards, Sergey
Open this post in threaded view
|

Re: Plotting oder of the half-transperent objects

 I am not sure what OpenRAVE uses for 3D graphics, but I have had issues in the past in other libraries with semi-transparent objects.  I think it was with OpenSceneGraph.  Overlaying multiple semi-transparent 3D objects is a harder problem than you think, and these realtime 3D graphics libraries just don't handle it well. -Ben -----Original Message----- From: Sergey [mailto:[hidden email]] Sent: Thursday, April 10, 2014 7:00 AM To: [hidden email] Subject: [OpenRAVE-users] Plotting oder of the half-transperent objects Hi All, Suppose one have such code that plots 3 spheres one in another with different Alpha channel values. Everything works fine when first we plot the small object, then middle (that contains small) and then the biggest (that contains small and middle).         small = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.1,                                    colors=np.array(((0,0,0,0.9))),                                    drawstyle=1))                 middle = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.5,                                    colors=np.array(((0,0,0,0.5))),                                    drawstyle=1))                 large = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize= 1,                                    colors=np.array(((0,0,0,0.1))),                                    drawstyle=1)) However, when we shift the order of plotting, e.g., first - middle, then small and then large:         middle = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.5,                                    colors=np.array(((0,0,0,0.5))),                                    drawstyle=1))                 small = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize=0.1,                                    colors=np.array(((0,0,0,0.9))),                                    drawstyle=1))                         large = (env.plot3(points=np.array(((-0.5,0.5,0))),                                    pointsize= 1,                                    colors=np.array(((0,0,0,0.1))),                                    drawstyle=1)) Only two objects are visible: middle and the biggest. The smallest is not plotted. So, the small objects that lays inside large and plotted later are not showed. Is that expected behavior? Otherwise one have to care about what to plot when and often try to keep it consistent. Thank you! Best regards, Sergey -- View this message in context: http://openrave-users-list.185357.n3.nabble.com/Plotting-oder-of-the-half-transperent-objects-tp4026951.htmlSent from the OpenRAVE Users List mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees_______________________________________________ Openrave-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openrave-users------------------------------------------------------------------------------ Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test & Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees_______________________________________________ Openrave-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openrave-users
Open this post in threaded view
|

Re: Plotting oder of the half-transperent objects

 Hi baxelrod and all, Thank you for the reply. Yes, sure. I was just interested if anybody else faced this problem. Perhaps the way to solve is to carefully track the order manually. A bit side question. In case of drawing a complicated shape that consists of many pieces, it appears by piece by piece while drawing. In case of redrawing everything starts to blink. Is it possible to buffer it somehow and then show it at all once? Best regards, Sergey