How about writing into a buffer of pixels and then display that as a texture?


Or draw a line from one point to itself.

Or draw a small rectangle for every point.


/Ingemar


Den 2017-01-13 kl. 17:58, skrev Ian Sloman:
I am trying to update some legacy OpenGL code that I wrote back in 2003. I have pixel data of a CT scan that I am trying to view. In the 2003 code I was able to use glDrawPixel to draw the pixel data. It appears that glDrawPixel does not exist anymore. What process should I be using to be able to draw the pixel data.

Here is the related code that I previously used:
@implementationRawDataView

// This function displays the selected CT data slice into
//       a pane in the upper-left hand corner of the viewing
//       window.
- (void)drawRect: (NSRect) theRect
{
unsignedchar*rawData_p;
intsliceNumber;


BOOLdebug = true;
if(debug) printf("RawDataView: drawRect: \n");


// get the desired slice and the address of the CT data array
sliceNumber = [CTDatagetDesiredSlice];
rawData_p = [CTDatagetRawSliceData];

// initialize OpenGL window
   //glMatrixMode(GL_PROJECTION);
   //glLoadIdentity();
 //gluOrtho2D(0.0, 2.0, 0.0, 1.0);
GLKMatrix4ortho2D = GLKMatrix4MakeOrtho(0.0, 2.0, 0.0, 1.0, 0.0, 100.0);


glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);


// display raw CT data slice
glRasterPos2i(0,0);


// for testing only - copy input vectors to log file
if(debug) printf("RawDataView: sliceNumber: %d \n", sliceNumber);


glDrawPixels(ROWS, COLS, GL_RGB, GL_UNSIGNED_BYTE, rawData_p+(49152*sliceNumber));
glFlush();
}

@end

I realize that I am going to have to change: gluOrtho2D(0.0, 2.0, 0.0, 1.0); as well.

Celebrate each day with family and friends,

Ian

132 Wintergreene Lane
Regina, SK S4S 0A7
Canada

E-mail: islom...@sasktel.net <mailto:islom...@sasktel.net>

Phone: 306-545-8568



  _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (Mac-opengl@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/mac-opengl/ingemar%40ragnemalm.se

This email sent to inge...@ragnemalm.se

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (Mac-opengl@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/mac-opengl/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to