Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

why can’t get pixel depth of proE model

lijz

New member
I am using pro/Toolkit to develope some code to read pixel depth of proE model from proE view window with openGL function glReadPixels(), but all I got was 1. Actually it should be different value for different pixel of the model displaying. The codes are as following,

const int width=1024;
const int height=768;
float z[width*height];
glReadPixels(0,0,width,height,GL_DEPTH_COMPONENT,GL_FLOAT,z) ;

Any comment is welcome and appreciated.
 
What would this be used for, just curious? Why would you want to know if a pixel is on or off? With digital displays pixels are either on or off, 1 or 0. Assuming that the background is set to black.
 
I don't think so. If the pixelswere set off as you said, itwould be no way for proE topick overlaped parts in the modeling view. It's the depth information called z-buffer that is using for proE to pick. I need this information to perform some simulation. But it seems not working though it isworking in some other modeling systems.
 
Hi,

I'm not guru in OpenGL, but it seems to me ProE has some "issues" with using OGL.
I have small app for SolidWorks, which draws some graphic, and recently I tried to move it to ProE, but unsuccessfully :(.
OGL graphic blinks and disappears all the time, I used the same call as in SW though.

But on the other hand ProE provides its own methods to manipulate graphics. Strangly, isn't it use OGL for this?

Cheers,
VovaN

Edited by: VovaN
 
Hi there. I'm sure proE also uses openGL.
I can read RGB information with glReadPixels() but just cannot read depth with the same function while they are all working in UG. I don't know why.
 

Sponsor

Articles From 3DCAD World

Back
Top