Page 1 of 1

Selection(picking) and OpenGL in Blender.

Posted: Mon Nov 07, 2005 10:58 am
by russose

I need some information about the selection process in Blender. To port Blender for pocketpc, I use OpenGL ES. But Opengl ES doesn't have functions like glSelectBuffer, gl*Name(), glRenderMode because they considered that applications can easily implement their own "picking mechanism".
Can someone provide me information about how Blender performs picking? I can imagine that Blender implements its own process, ... maybe with pick ray? I don't think that Blender rellied on the eavy "OpenGL picking Mecanism". Am I wrong?

Do someone have so information about that? Is there any documentation on the selection mechanism in Blender?
Or do you thing that all these Opengl functions (glSelectBuffer, gl*Name(), glRenderMode ) are so deeply used by Blender that there will be no other choise as wrapping them?.

Thanks for your help,

PS: For an other exaple, glBitmap is not supported by OpenglES but Blender only use them for font (and update Raster position what is easy to wrapp). Blender supports Texture Font so I didn't needed to fully implement glBitmap :=)

Re: My opinion

Posted: Mon Nov 28, 2005 6:19 am
by kidb
pump63506 wrote::o) Well thats exactly what i thought.:lol::lol:
One more casino spammer!

Posted: Mon Nov 28, 2005 10:16 am
by LetterRip
there is a pick_ray function in blender (grep in source directory) I think picking has been implemented three or four different times in blender. Theeth also implemented one in in transform code, and a few of the selection methods probably have their own also.


Posted: Mon Nov 28, 2005 12:59 pm
by russose
Hallo LetterRip,

I will have a look on the code. I already check and find this functions but I don't really focus on that for the moment. I am now improving the "easy" stuf of the wrapper, then I will have to deal with two major problems:
*This selection and picking
*Front and back buffer.... in Opengl ES, only back buffer and it is so low level to access buffer individually that I have no idea for the moment!

But in the next day, I plan to publish a blog summaring my work to able more people to participate if they like (or just better follow the evolution of the project and eventually give some advice :=) ). I will also give some screenshoots but as I said, my blender is not good!

Thanks again for the information,

Posted: Wed Nov 30, 2005 8:08 am
by dmoc
Don't know if Blender uses this technique but I have in my own sw: redraw pickable elements in different colours (one per element) then just check the colour under the cursor.

Posted: Wed Nov 30, 2005 9:52 am
by russose
Hallo dmoc,

I am now wondering if I should emulate the selection picking of opengl or use your other method described in the redbook. But to really go head, I miss global information on how Blender is using the "selection and feedback" information... how Blender is doing selection. I will better study the source code as soon as I will deal with selection.


Posted: Wed Nov 30, 2005 6:37 pm
by LetterRip

yep blender uses (or used to) use that picking method for the painting modes.