Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!isl1.ri.cmu.edu!cycy From: cycy@isl1.ri.cmu.edu (Scum) Newsgroups: comp.sys.sgi Subject: putting and retrieving colours...help! Message-ID: <10335@pt.cs.cmu.edu> Date: 28 Aug 90 03:27:01 GMT Organization: Carnegie-Mellon University, CS/RI Lines: 49 I'm having a very vexxing problem right now. I'm in doublebuffer, RGB mode. In the backbuffer, I draw an object in 3-space with 0x01f as it's colour. Just before this, I turn off lighting mode by binding the material to 0, set the shademodel to FLAT, and even turn off zbuffering. What I get immediately back, however, is 0x11 ! To get the colour of the pixel, I cmov to a position where I drew the object, and use readRGB. Can somebody help me? I'm getting quite frustrated.... -- Chris. (cycy@ri.cmu.edu) printf statements have been removed. ptr->on_colour is an unsigned long. ... ... ... ... if (flag & PCOLOURS) { unsigned short red, green, blue; czclear(0x00000000, 0xffffff); zbuffer(FALSE); shademodel(FLAT); lmbind(MATERIAL, 0); for (ptr= obj_inst; ptr != NULL; ptr = ptr->next) { short r,b,g; unsigned char cr, cg, cb; green = (short) ((ptr->on_colour>>8) & 0x0ff); blue = (short) ((ptr->on_colour>>16) & 0x0ff); red = (short) (ptr->on_colour & 0x0ff); fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue); RGBrange(red, green, blue, red, green, blue, -1023, 0); cpack(ptr->on_colour); (ptr->d_funct) (ptr); cmov(ptr->params[0].arg,ptr->params[1].arg,ptr->params[2].arg); readRGB(1,&cr,&cg,&cb); } RGBrange(0, 0, 0, 255, 255, 255, -1023, 0); zbuffer(TRUE); shademodel(GOURAUD); } } -- -- Chris. (cycy@isl1.ri.cmu.edu) "People make me pro-nuclear." -- Margarette Smith