Thread: [PyOpenGL-Users] Basic query regarding glSelectBuffer
Brought to you by:
mcfletch
|
From: Abhijeet R. <abh...@gm...> - 2011-04-18 12:03:29
|
Hi, I am not clear as to how do we use glSelectBuffer in pyopengl. So far, I have tried to convert it to python and my attempt is as follows: *Python code:- http://sprunge.us/JPUj?python C++ code:- http://sprunge.us/YPhU?c++* *Corresponding C++ code is (If you want just the part required):-* // Space for selection buffer static GLuint selectBuff[BUFFER_LENGTH]; //Something else //Setup selection buffer glSelectBuffer(BUFFER_LENGTH, selectBuff); //Some more stuff, and its now used in the code like hits = glRenderMode(GL_RENDER); //Other stuff.. if(hits > 0){ //something's been selected unsigned int choiche; // fi there's more than one figure (or control point) selected, take the top one if (hits > 1) choiche = selectBuff[(hits*4)-1]; else choiche = selectBuff[3]; cpsel = false; if (win == 1) { selWin1(selectBuff); } else if (win == 2){ sel = true; if (choiche < figureSet.size()) // figure selected selected = choiche; else{ // it's a control point cpsel = true; cp = choiche; } } } ___________________________________________________________ A quick reply will be highly appreciated as I have a deadline to submit a project. -- Regards, Abhijeet Rastogi (shadyabhi) http://www.google.com/profiles/abhijeet.1989 |
|
From: Abhijeet R. <abh...@gm...> - 2011-04-18 12:07:00
|
Also, I have noticed that in python, *glSelectBuffer (size) → None *is the specification. So, how am I supposed to use selectBuff. Because in C++, we also pass selectBuff's reference to the function. On Mon, Apr 18, 2011 at 5:33 PM, Abhijeet Rastogi <abh...@gm...>wrote: > Hi, > > I am not clear as to how do we use glSelectBuffer in pyopengl. > > So far, I have tried to convert it to python and my attempt is as follows: > *Python code:- http://sprunge.us/JPUj?python > C++ code:- http://sprunge.us/YPhU?c++* > ** > -- Regards, Abhijeet Rastogi (shadyabhi) http://www.google.com/profiles/abhijeet.1989 |
|
From: Joshua R. D. <joshuardavis@q.com> - 2011-04-18 12:16:47
|
You just pass in the buffer size. This is in the code I pointed you to. selectionBufferCapacity = 64 glSelectBuffer(selectionBufferCapacity) Josh On 2011 Apr 18, at 7:06 AM, Abhijeet Rastogi wrote: > Also, I have noticed that in python, glSelectBuffer (size) → None is the specification. So, how am I supposed to use selectBuff. Because in C++, we also pass selectBuff's reference to the function. > > On Mon, Apr 18, 2011 at 5:33 PM, Abhijeet Rastogi <abh...@gm...> wrote: > Hi, > > I am not clear as to how do we use glSelectBuffer in pyopengl. > > So far, I have tried to convert it to python and my attempt is as follows: > Python code:- http://sprunge.us/JPUj?python > C++ code:- http://sprunge.us/YPhU?c++ > > > > > -- > Regards, > Abhijeet Rastogi (shadyabhi) > http://www.google.com/profiles/abhijeet.1989 > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev_______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users Joshua R. Davis joshuardavis@q.com |
|
From: Abhijeet R. <abh...@gm...> - 2011-04-18 12:40:10
|
Thanks Davis for your reply. But, then in C++ code, I have used it too... ( like in choiche = selectBuff[(hits*4)-1];)... So, what will I do in python code? On Mon, Apr 18, 2011 at 5:46 PM, Joshua R. Davis <joshuardavis@q.com> wrote: > You just pass in the buffer size. This is in the code I pointed you to. > > selectionBufferCapacity = 64 > glSelectBuffer(selectionBufferCapacity) > > Josh > > On 2011 Apr 18, at 7:06 AM, Abhijeet Rastogi wrote: > > > Also, I have noticed that in python, glSelectBuffer (size) → None is the > specification. So, how am I supposed to use selectBuff. Because in C++, we > also pass selectBuff's reference to the function. > > > > On Mon, Apr 18, 2011 at 5:33 PM, Abhijeet Rastogi < > abh...@gm...> wrote: > > Hi, > > > > I am not clear as to how do we use glSelectBuffer in pyopengl. > > > > So far, I have tried to convert it to python and my attempt is as > follows: > > Python code:- http://sprunge.us/JPUj?python > > C++ code:- http://sprunge.us/YPhU?c++ > > > > > > > > > > -- > > Regards, > > Abhijeet Rastogi (shadyabhi) > > http://www.google.com/profiles/abhijeet.1989 > > > ------------------------------------------------------------------------------ > > Benefiting from Server Virtualization: Beyond Initial Workload > > Consolidation -- Increasing the use of server virtualization is a top > > priority.Virtualization can reduce costs, simplify management, and > improve > > application availability and disaster protection. Learn more about > boosting > > the value of server virtualization. > http://p.sf.net/sfu/vmware-sfdev2dev_______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > Joshua R. Davis joshuardavis@q.com > > > > -- Regards, Abhijeet Rastogi (shadyabhi) http://www.google.com/profiles/abhijeet.1989 |
|
From: Mike C. F. <mcf...@vr...> - 2011-04-19 22:04:58
|
On 11-04-18 08:39 AM, Abhijeet Rastogi wrote: > Thanks Davis for your reply. > But, then in C++ code, I have used it too... ( like in choiche = > selectBuff[(hits*4)-1];)... So, what will I do in python code? See the PyOpenGL documentation for glSelectBuffer, in the section Sample Code References you'll find a few links to sample code, including from OpenGLContext. Basically you get back a list from the glRenderMode() call and you can iterate over the (near,far,names) records in that list: http://pyopengl.sourceforge.net/documentation/manual-3.0/glSelectBuffer.xhtml HTH, Mike > > On Mon, Apr 18, 2011 at 5:46 PM, Joshua R. Davis <joshuardavis@q.com > <mailto:joshuardavis@q.com>> wrote: > > You just pass in the buffer size. This is in the code I pointed > you to. > > selectionBufferCapacity = 64 > glSelectBuffer(selectionBufferCapacity) > > Josh > > On 2011 Apr 18, at 7:06 AM, Abhijeet Rastogi wrote: > > > Also, I have noticed that in python, glSelectBuffer (size) → > None is the specification. So, how am I supposed to use > selectBuff. Because in C++, we also pass selectBuff's reference to > the function. > > > > On Mon, Apr 18, 2011 at 5:33 PM, Abhijeet Rastogi > <abh...@gm... <mailto:abh...@gm...>> wrote: > > Hi, > > > > I am not clear as to how do we use glSelectBuffer in pyopengl. > > > > So far, I have tried to convert it to python and my attempt is > as follows: > > Python code:- http://sprunge.us/JPUj?python > > C++ code:- http://sprunge.us/YPhU?c++ > > > > > > > > > > -- > > Regards, > > Abhijeet Rastogi (shadyabhi) > > http://www.google.com/profiles/abhijeet.1989 > > > ------------------------------------------------------------------------------ > > Benefiting from Server Virtualization: Beyond Initial Workload > > Consolidation -- Increasing the use of server virtualization is > a top > > priority.Virtualization can reduce costs, simplify management, > and improve > > application availability and disaster protection. Learn more > about boosting > > the value of server virtualization. > http://p.sf.net/sfu/vmware-sfdev2dev_______________________________________________ > > PyOpenGL Homepage > > http://pyopengl.sourceforge.net > > _______________________________________________ > > PyOpenGL-Users mailing list > > PyO...@li... > <mailto:PyO...@li...> > > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > Joshua R. Davis joshuardavis@q.com <mailto:joshuardavis@q.com> > > > > > > > -- > Regards, > Abhijeet Rastogi (shadyabhi) > http://www.google.com/profiles/abhijeet.1989 > > > ------------------------------------------------------------------------------ > Benefiting from Server Virtualization: Beyond Initial Workload > Consolidation -- Increasing the use of server virtualization is a top > priority.Virtualization can reduce costs, simplify management, and improve > application availability and disaster protection. Learn more about boosting > the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev > > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |