Results 1 to 3 of 3

Thread: Replacement of glFeedbackBuffer in ogl 3.3 nd abve

  1. #1
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Replacement of glFeedbackBuffer in ogl 3.3 nd abve

    Hi all,
    What is the replacement of glFeedbackBuffer in opengl 3.3 since the core profile has removed it. I want to obtain the screen space position of my mesh. From my survey it seems that I would need to do it manually which shouldn't be difficult. Multiply the objects geometric center by the MVP matrix and then do the homogeneous division and finally viewport transform to get the screen coordinate. Am I correct. So putting it in GLSL syntax, it should be this,
    Code :
    vec3 center = GetCenter(pMesh);
    vec4 center_clip_space = MVP*vec4(center,1);
    center_clip_space.xyz/=center_clip_space.w;
    vec2 half_dim = vec2(viewport.width,viewport.height)*0.5;
    vec2 screen_space = (center_clip_space.xy * half_dim) + half_dim; //brings the screen space coord. to viewport size in XY

    One more thing, is there any place which list the deperecated/removed func. and their replacements?

    Thanks,
    Mobeen
    Regards,
    Mobeen

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: Replacement of glFeedbackBuffer in ogl 3.3 nd abve

    OK i am not getting the correct result. I give an example here:
    Code :
    os_pos = (-10,0,-30,1);
    MVP=[    1.8107         0         0         0
             0    0.0001   -1.0010   -1.0000
             0   -2.4142         0         0
      -18.1066         0   20.0250   30.0000];
    cs_pos = MVP*os_pos; //which is 
    cs_pos = (-18.106602, 29.030016, 0.0013448675,-389.68439);
    ndc = cs_pos.xyz/cs_pos.w;// which is
    ndc = (0.046464786, -0.074496225, -3.4511711e-006, 1.0);
    after viewport transform I get (335,222) pixel coordinates

    Now doing the same calc. with another object at
    Code :
    os_pos=(10,0,-30,1);
    MVP=[1.8107     0         0         0
             0    0.0001   -1.0010   -1.0000
             0   -2.4142   -0.0000   -0.0000
       18.1066         0   20.0250   30.0000] 
    gives me clip space pos (18.106602,29.030016, 0.0013448675,-389.68439) and after homogenous division gives me,
    -0.046464786,-0.074496225,-3.4511711e-006,1.0).

    After viewport transform, I get pixel coordinates(305,222). So i suspect there is something wrong. Any ideas?
    Note that my viewport size is 640 x 480. I expect the coordinates to be closer to (120,240) for the first object and (520,240) What Am i doing wrong?
    Regards,
    Mobeen

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: Replacement of glFeedbackBuffer in ogl 3.3 nd abve

    OK got it working. My vector matrix multiplication func. was multiplying the matrix wrongly. It works fine now.
    Regards,
    Mobeen

Similar Threads

  1. occlusion with glFeedbackBuffer?
    By leoptimus in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-27-2003, 11:07 PM
  2. glFeedbackBuffer consistency
    By blueskyday in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-05-2003, 02:02 AM
  3. Need some help on glfeedbackbuffer
    By Inutile in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-05-2001, 02:10 AM
  4. replacement for GVS
    By Rarlund in forum OpenGL: General
    Replies: 2
    Last Post: 03-01-2001, 03:37 PM
  5. GVS replacement on Linux
    By Rarlund in forum OpenGL: Linux
    Replies: 0
    Last Post: 01-24-2001, 05:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean