From: <jen...@ag...> - 2003-01-02 12:53:43
|
hi to all & a happy new year, i have some troubles to get my picking&selecting routine working. to show you the problem i have changed the "select"-demo form MiscDemos shipped with the GL4Java demos. the original Render method: public void Render( int mode ) { int i; for(i=0; i < objectCount; i++) { if(mode == GL_SELECT ) { gl.glLoadName(i); } // ... drawing object[i] ... } } so far so good, this works fine. the changed method: public void Render( int mode ) { int i; for( i=0; i < objectsCount; i++ ) { if(mode == GL_SELECT ) { gl.glPushName(i); } // ... drawing object[i]; if( mode == GL_SELECT ) { gl.glPopName(); } } } and this won't work ( Java 1.4.0 & GL4Java 2.8.2.0 ). The glRenderMode(...) correctly returns the number of hits ( 0|1) but the selectBuffer is empty SOMETIMES ( while a hit is returned )! furthermore clicks ( random number ) on the same coordinates will mostly return 1 hit / selectBuffer empty but also sometimes the correct values. I deleted in this demo in method DoSelect(...) the gl.glPush(~0); and the demo works fine but in my project the effect still remains. any ideas ? thanks, Jens |