Sun Phigs lighting model

Phill Everson phill at med-image.compsci.bristol.ac.uk
Mon Jan 29 03:30:04 AEST 1990


We're having a number of problems with Sun Phigs (v1.1) here running on
SS1s and Sparc370's under SunOS4.03. Sun UK answer centre is baffled, but
I'm sure someone somewhere can help ...

If anyone could give any pointers to solutions or any sample code of
greater complexity (and usefulness) than the demos included with the
package please contact me. I will summarize to the net if there is
significant reponse.

1. We are using polyhedron3 with a lighting model and don't see any
apparent differences on the rendered model with the on or off. We use the
following code to set up the light sources:

	  Plightsrcbundl  lrep[4];

	  lrep[0].type = PLIGHT_POSITIONAL;
      lrep[0].rec.positional.colour.type = PINDIRECT;
      lrep[0].rec.positional.colour.val.index = PYELLOW;
      lrep[0].rec.positional.pos.x = WC_MAX;
      lrep[0].rec.positional.pos.y = 0.0;
      lrep[0].rec.positional.pos.z = 0.0;
      lrep[0].rec.positional.coef[0] = 0.0;
      lrep[0].rec.positional.coef[1] = 1.0;

      lrep[1].type = PLIGHT_AMBIENT;
      lrep[1].rec.ambient.colour.type = PINDIRECT;
      lrep[1].rec.ambient.colour.val.index = PCYRAN;

      lrep[2].type = PLIGHT_POSITIONAL;
      lrep[2].rec.positional.colour.type = PINDIRECT;
      lrep[2].rec.positional.colour.val.index = PYELLOW;
      lrep[2].rec.positional.pos.x = WC_MAX * -1.0;
      lrep[2].rec.positional.pos.y = 5.0;
      lrep[2].rec.positional.pos.z = 0.0;
      lrep[2].rec.positional.coef[0] = 0.0;
      lrep[2].rec.positional.coef[1] = 1.0;

	  popenws(WS, (Pconnid)canvas, canwst);

      psetlightsrcrep (WS, 1, &(lrep[0]));
      psetlightsrcrep (WS, 2, &(lrep[1]));
      psetlightsrcrep (WS, 3, &(lrep[2]));

2) Attenuation Coefficients. What are sensible values to plug in to get a
noticable effect on the rendered model from the light source?

3) Rendering to pixrects. Is there *any* way of rendering a model into a
pixrect directly rather than a workstation/canvas using Sun Phigs so that
we can the do a pw_stencil() of that pixrect on top of another image?

Any help, pointers, hints or sample code on any of the above problems
would be deeply appreciated. Please email and I will summarize.

Phillip G. Everson
Senior Software Engineer                  Medical Imaging
Philips Radiotherapy Systems              Dept. Computer Science
Horfield Road, Bristol, UK                Bristol University, UK



More information about the Comp.sys.sun mailing list