From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/17855 Path: main.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: shading in meta[post/play] & PDF Date: Sat, 15 Jan 2005 06:16:48 +0100 Message-ID: <41E8A740.7010703@email.si> Reply-To: mojca.miklavec@guest.arnes.si, mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050703060901000806020303" X-Trace: sea.gmane.org 1105766229 20431 80.91.229.6 (15 Jan 2005 05:17:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2005 05:17:09 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Jan 15 06:17:03 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CpgJ4-0006J1-00 for ; Sat, 15 Jan 2005 06:17:02 +0100 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 74FF6127C2; Sat, 15 Jan 2005 06:17:02 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15990-04; Sat, 15 Jan 2005 06:17:01 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 28978127B4; Sat, 15 Jan 2005 06:17:01 +0100 (CET) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0F30D127B4 for ; Sat, 15 Jan 2005 06:16:59 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15954-04 for ; Sat, 15 Jan 2005 06:16:58 +0100 (CET) Original-Received: from avs3.arnes.si (unknown [193.2.1.68]) by ronja.ntg.nl (Postfix) with ESMTP id 1DD97127AE for ; Sat, 15 Jan 2005 06:16:58 +0100 (CET) Original-Received: from localhost (avs3.arnes.si [193.2.1.68]) by avs3.arnes.si (Postfix) with ESMTP id ECBDE1D7B65; Sat, 15 Jan 2005 06:16:57 +0100 (CET) Original-Received: from avs3.arnes.si ([193.2.1.68]) by localhost (avs3.arnes.si [193.2.1.68]) (amavisd-new, port 10024) with ESMTP id 01336-04; Sat, 15 Jan 2005 06:16:57 +0100 (CET) Original-Received: from [192.168.2.102] (ACB2FD4C.ipt.aol.com [172.178.253.76]) by avs3.arnes.si (Postfix) with ESMTP id D0D741D7ABF; Sat, 15 Jan 2005 06:16:51 +0100 (CET) User-Agent: Mozilla/4.5-4.75 (Windows; U; Windows NT 5.1; sl-SI; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: sl, en, en-us, de Original-To: mailing list for ConTeXt users , metapost@tug.org X-Virus-Scanned: by amavisd-new at arnes.si X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:17855 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:17855 This is a multi-part message in MIME format. --------------050703060901000806020303 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit There's a wonderful tutorial on drawing 3D graphics in PostScript on http://www.math.ubc.ca/~cass/graphics/manual/, specifically http://www.math.ubc.ca/~cass/graphics/manual/code/doughnut.eps as an example. And there's a detailed description on shading in PostScript in http://partners.adobe.com/public/developer/en/ps/PLRM.pdf, page 259 (I attached an example and have some more on computer if anyone is interested; I downloaded them from Adobe, but don't know the URL any more) or on shading in PDF in http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf, page 272. (They're basically the same.) In metapost, "perfect" spheres can be drawn, like on http://www.gnu.org/software/3dldf/cdsmpls.html. But how can I add colour? Even if it would be too tricky to add colour and proper shading on the sphere - Is there any possibility to use advanced shading techiques described in PLRM inside metapost/metaplay for the most simple cases, say, like in the attached example? Metaplay allows circular and gradient shading and no others. I don't mind if I had to hard-code the shading. PSTricks allows some more advanced shading techniques and even direct PostScript code integration (with \special I think). Is anything similar possible in metapost/play? The spheres drawn directly in PostScript as in the examples above still have straight lines (well, I agree that with some mathematics it would be possible to draw them with proper splines as well). Thanks for all the suggestions, Mojca --------------050703060901000806020303 Content-Type: application/postscript; name="DECAHED.PS" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="DECAHED.PS" %!PS-Adobe-3.0 Resource-ProcSet %%Title: Decahed.ps %%Creator: Henry McGilton for Adobe Systems Incorporated %%CreationDate: 3/5/97 %!History: %%Version: 1.0 %!Environments: Level 3, CPSI %! %!Purpose: %! Another example of free-form Gouraud shading %! %!StandAlone: true %! %!KnownProblems: %! %!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %! Copyright (c) 1992-1997 Adobe Systems Incorporated. % %! All rights reserved. % %! % %! NOTICE: All information contained herein is the property of % %! Adobe Systems Incorporated. Reproduction or dissemination of % %! this software is strictly forbidden unless prior written % %! permission is obtained from Adobe. % %!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%EndComments /inch { 72 mul } def /middle_rad 4 inch def 4.25 inch 5.5 inch translate /DeviceRGB setcolorspace << /ShadingType 4 /ColorSpace [ /DeviceRGB ] /DataSource [ 0 % start a new triangle 2 inch 2 inch % first vertex 1 1 1 % color = white at that vertex 0 % dummy edge flag middle_rad 36 cos mul middle_rad 36 sin mul 1.0 0.6 0.0 0 % dummy edge flag middle_rad 72 cos mul middle_rad 72 sin mul 0.8 1.0 0.0 2 % next triangle shares with previous middle_rad 108 cos mul middle_rad 108 sin mul 0.2 1.0 0.0 2 middle_rad 144 cos mul middle_rad 144 sin mul 0.0 1.0 0.4 2 middle_rad 180 cos mul middle_rad 180 sin mul 0.0 1.0 1.0 2 middle_rad 216 cos mul middle_rad 216 sin mul 0.0 0.4 1.0 2 middle_rad 252 cos mul middle_rad 252 sin mul 0.2 0.0 1.0 2 middle_rad 288 cos mul middle_rad 288 sin mul 0.8 0.0 1.0 2 middle_rad 324 cos mul middle_rad 324 sin mul 1.0 0.0 0.6 2 middle_rad 360 cos mul middle_rad 360 sin mul 1.0 0.0 0.0 2 middle_rad 36 cos mul middle_rad 36 sin mul 1.0 0.6 0.0 ] >> shfill showpage --------------050703060901000806020303 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------050703060901000806020303--