🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1886

graduated triangle fills?

#1886
From: Nigel O'Brian
Date: Tue, 08 Sep 1992 05:10
22 lines
1375 bytes
This might be a bit optimistic, but does anyone have a routine
to do a graduated grayscale fill inside a triangular path? 
Something like

x1 y1 x2 y2 x3 y3 gray1 gray2 gray3 gradfill

producing a triangle with specified vertices, and a more or less
linearly varying gray taking the specified values at the vertices.
I want it for 3D shading. Something recursive should
work -- maybe generating 4 invocations corresponding to
the subdivision of the triangle given by joining mid-points of 
sides. Depth can be controlled by maximum variation of grays
at the vertices. Perhaps such a routine would be of general
interest? 


--
=================================================================
Nigel O'Brian                             obrian_n@maths.su.oz.au
School of Mathematics                     nigel@frog.maths.su.oz
University of Sydney                      Ph: (02)-692-4083
Sydney NSW 2006, Australia                FAX: (02)-692-4534
Technical Details
Message-ID: <NIGEL.92Sep8151038@frog.maths.su.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!metro.ucc.su.oz.au!nigel

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!metro.ucc.su.oz.au!nigel
From: nigel@maths.su.oz.au (Nigel O'Brian)
Subject: graduated triangle fills?
Message-ID: <NIGEL.92Sep8151038@frog.maths.su.oz.au>
Sender: news@ucc.su.OZ.AU
Nntp-Posting-Host: frog.maths.su.oz.au
Organization: School of Mathematics, University of Sydney
Date: Tue, 8 Sep 1992 05:10:38 GMT
Lines: 30