Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  wrong value from feedback?  (Read 613 times)
0 Members and 1 Guest are viewing this topic.
Offline knitte

JGO n00b
*

Posts: 46


i eat gosus like pacman does!


« on: 2005-10-11 14:46:05 »

Hi,
 this is my feedback line where i set the token for the vertex...
1  
2  
3  
4  
5  
6  
7  
gl.glPassThrough(1.0f);
     
      gl.glBegin(GL.GL_POINTS);
        gl.glVertex3f(-1.0f, 1.0f, 0.0f);  
      gl.glEnd();
     
      gl.glPassThrough(2.0f);


now i get this value from the FloatBuffer: 1792.0
 i dont know why.
 i need the coordinates, but i just get this one value...

i am using this buffer
1  
2  
FloatBuffer feedbackBuffer = BufferUtils.newFloatBuffer(4);
 gl.glFeedbackBuffer(4, GL.GL_3D, feedbackBuffer);


anyone has an idea?  Huh

PS: byteorder is little endian
Offline Ken Russell

JGO Kernel
*****

Posts: 3446
Medals: 3


Java games rock!


« Reply #1 on: 2005-10-11 17:44:20 »

1792 is 0x700 which is GL_PASS_THROUGH_TOKEN. Have you looked at the documentation for the feedback buffer?
Offline knitte

JGO n00b
*

Posts: 46


i eat gosus like pacman does!


« Reply #2 on: 2005-10-11 17:57:03 »

Hi, yes.
I implented this perspectiv :
1  
glu.gluPerspective(60.0, this.h, 1.0, 20.0);


now i have also the 1793.0 for GL_POINT_TOKEN, plus this Values:

1793.0
3
226.01904
4
190.98096

i think 226 is x
and 190 is y

but i dont know how to work with this values, the originals are -1.0f and 1.0f ... hmmm
... hmm why arent them -1.0 and 1.0 ??
Games published by our own members! Go get 'em!
Offline Ken Russell

JGO Kernel
*****

Posts: 3446
Medals: 3


Java games rock!


« Reply #3 on: 2005-10-11 19:41:32 »

From the man page:
1  
Feedback vertex coordinates are in window coordinates except w, which is in clip coordinates

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 21 queries.