Home > Back-end >  OpenGL rendering 3 d grayscale
OpenGL rendering 3 d grayscale

Time:04-24

, ladies and gentlemen, I'd like to open a picture through single document, and then according to the grey value in this figure drawing a 3 d figure of similar mountain valley (such as 255 peaks, 0 is the valley), but the actual operation have no direction, baidu also failed, to help you requested

CodePudding user response:

In the vertex shader read the texture of the gray level, based on the coordinate of the gray scale

CodePudding user response:

Excel seems to bring their own 3 d figure,

CodePudding user response:

reference 1st floor Italink response:
in the vertex shader read the texture of the gray level, based on the coordinate of the gray line

Can you point in detail? Because is indeed a first contact with OpenGl, not familiar with

CodePudding user response:

Learn OpenGL suggestion system, learn about it is not difficult to do this just like a headless fly really otherwise, mulling over, recommend a OpenGL tutorial site, LearnOpenGL

CodePudding user response:

The implementation approach is roughly such
First draw a fixed size of rectangle (in the true sense is not a rectangle, but many small triangle pieced together, such as a rectangular 200 * 200, 100 can be divided into 20 * 20 small rectangular, each small rectangle and two triangles), read the texture in the vertex shader, according to the texture data, processing of rectangle segment vertex coordinates, can get what you want to images, subdivision number is higher, the precision of the graphics is higher
  • Related