Selection/Picking ---Imported Drawing?

hey…
how will selection/picking work for an imported drawing…e.g. i want to select/pick drawing in my application that was created in another software such as AutoCad or Paint

thanks

It doesn’t matter what you pick.
The picking routine:

  glMatrixMode(GL_PROJECTION);  
  glLoadIdentity();
  gluPickMatrix(...);
  GLuint pickedBuffer[100];
  glSelectBuffer(100, pickedBuffer);
  glRenderMode(GL_SELECT);
  for(all objects in scene) {
    glLoadName(your object ID);
    render(object)
  }
  int pickedObjects = glRenderMode(GL_RENDER);
  for(int i=0; i<pickedObjects ; i++) {
    // process picked object with id pickedObjects [i];
  }

A list of IDs is returned to your buffer registered via glSelectBuffer.
It doesn’t matter what is inside the render function that renders the object.

kindly explain these lines in detail?
for(all objects in scene)
{ glLoadName(your object ID);
render(object) }

does this mean we have to reload the drawing in select mode ??
I am not clear how we will assign IDs because we are importing the drawing

But what is really the problem you’re having with drawing and picking imported objects?

The procedure for picking a non-imported objects is to load the ID that identifies the object to select, and then draw it. The hit record will contain any ID within the selction.

That’s exactly the same procedure for imported objects. Load the ID that identifies the object, and draw it. How you assign the ID is completely up to you. Just generate a unique ID the same way you generate it for non-imported objects.

thanks for explaining