mobeen

01-17-2011, 08:53 PM

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,

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

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,

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