🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13463

Sun Phigs lighting model

#13463
From: Phill Everson
Date: Sun, 28 Jan 1990 16:30
57 lines
2902 bytes
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
Technical Details
Message-ID: <4530@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!rice!sun-spots-request
From: phill@med-image.compsci.bristol.ac.uk (Phill Everson)
Newsgroups: comp.sys.sun
Subject: Sun Phigs lighting model
Keywords: Software
Message-ID: <4530@brazos.Rice.edu>
Date: 28 Jan 90 16:30:04 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 57
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 9, Issue 16, message 12 of 18