From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11455 invoked from network); 19 Jul 2023 17:10:46 -0000 Received: from cgl.ntg.nl (5.39.185.202) by inbox.vuxu.org with ESMTPUTF8; 19 Jul 2023 17:10:46 -0000 Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 00DF84816B1 for ; Wed, 19 Jul 2023 19:10:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6AX2-7wbnvnw for ; Wed, 19 Jul 2023 19:10:41 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id BF11E482B89 for ; Wed, 19 Jul 2023 19:07:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E3BE4482A3E for ; Wed, 19 Jul 2023 19:07:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ry5dsglnuwQe for ; Wed, 19 Jul 2023 19:07:04 +0200 (CEST) Received: from relay.yourmailgateway.de (relay.yourmailgateway.de [188.68.63.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 8C797482A3D for ; Wed, 19 Jul 2023 19:07:04 +0200 (CEST) Received: from mors-relay8204.netcup.net (localhost [127.0.0.1]) by mors-relay8204.netcup.net (Postfix) with ESMTPS id 4R5j0m1kTnz8ZKc for ; Wed, 19 Jul 2023 17:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiee.net; s=key2; t=1689786424; bh=O6rdpIRyblGpU7HN2BkosV9EGI9L4jTa4Qi+WSMFsr8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=dVcKdhcatqoyHnN5zKLUr3HMuvsdSr2c6i6Z51d6QawxnrBDtYRlR1pwdlHyou4AY zcZ2oi2DsI8Hloo4fhYEwzf0CDNty4xOU0Vs0RqxYJ9O5SZrukMjt4LNPPfjidJMtA fr7UZ/BlNLal8Ug1ioFt2sxtI4qhPXBnE7y0YdOtf3zcH8LJFuUGoFRWrioNMAa+bT rSJ1Eknal6QwAilxO31xyTyzxZxDU3GzrJqIwaQ3TuusIu9MpZaW9dacFd3cgIWkoR iM1q3J3vlRbkR3x6OKBzT9e69UIDThsJYBxrhv0JQ1Pv1bvUkLf+FFOMteio4sAbh6 CpiyYZTKzUv5g== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay8204.netcup.net (Postfix) with ESMTPS id 4R5j0m13PBz8Z25 for ; Wed, 19 Jul 2023 17:07:04 +0000 (UTC) Received: from mxf9ac.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4R5j0l6HGzz8sZR for ; Wed, 19 Jul 2023 19:07:03 +0200 (CEST) Received: from [192.168.178.23] (dslb-178-003-062-069.178.003.pools.vodafone-ip.de [178.3.62.69]) by mxf9ac.netcup.net (Postfix) with ESMTPSA id 4A23312002D for ; Wed, 19 Jul 2023 19:06:59 +0200 (CEST) Authentication-Results: mxf9ac; spf=pass (sender IP is 178.3.62.69) smtp.mailfrom=texml@fiee.net smtp.helo=[192.168.178.23] Received-SPF: pass (mxf9ac: connection is authenticated) Content-Type: multipart/mixed; boundary="------------iVVpDz4BBMmH0zmNFFUdwUlF" Message-ID: <1f46b8cb-bacf-13c3-80b4-66752071b481@fiee.net> Date: Wed, 19 Jul 2023 19:06:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: de-DE To: ntg-context@ntg.nl References: <36b2de99-972e-fd30-b62c-82855424a789@fiee.net> <95C3DFDF-FF4F-422B-B588-6389144F8D0C@bittext.nl> From: Henning Hraban Ramm In-Reply-To: <95C3DFDF-FF4F-422B-B588-6389144F8D0C@bittext.nl> X-PPP-Message-ID: <168978641951.7399.5206147104319702733@mxf9ac.netcup.net> X-Rspamd-Queue-Id: 4A23312002D X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: n/JVfxnAo2CSKMYxfOhl+5c5MKPG9Hc5pGtrE/Qg Message-ID-Hash: L2FM2QIOSGC3P3SEX3JVXOEI7EVRYFG6 X-Message-ID-Hash: L2FM2QIOSGC3P3SEX3JVXOEI7EVRYFG6 X-MailFrom: texml@fiee.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: enhancing MetaPost presentation progress graphics List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This is a multi-part message in MIME format. --------------iVVpDz4BBMmH0zmNFFUdwUlF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Am 19.07.23 um 14:07 schrieb Taco Hoekwater: > First, find the actual point along the curve of the wave you want, then you can ask for the direction of the wave at that time, and its point: Thank you! > pair itime, iangle, boatpos; > > itime = (wave[3] intersectiontimes ((xpos,0)--(xpos,infinity))); > iangle = direction (xpart itime) of wave[3]; > boatpos = (point (xpart itime) of wave[3]) shifted (-5,0); % shift to center horizontally There was still an error that I introduced: The boat on the first page is already way in, while on the last page it falls over the edge of the world. I fixed several other things and drew a nicer boat. Feel free to use it. Hraban --------------iVVpDz4BBMmH0zmNFFUdwUlF Content-Type: application/x-tex; name="boat.tex" Content-Disposition: attachment; filename="boat.tex" Content-Transfer-Encoding: 7bit %% presentation counter with a boat %% 2023 by Henning Hraban Ramm with help from Taco Hoekwater %% license: GNU FDL & CC BY-SA (latest versions) \setuppapersize[SW] \setuppagenumbering[state=stop,location=,] \startuseMPgraphic{Waves} numeric waveheight, stops, yoffset, wavecount, boatwidth, boatheight; path wave[]; pair itime, iangle, boatpos, boatsize; stops := 10; wavecount := 3; boatwidth := 21; boatheight := 21; boatsize := (boatwidth,boatheight); xpos := (OverlayWidth * RealPageNumber/NOfPages) - (OverlayWidth/2/NOfPages); waveheight := (OverlayHeight/20); definecolor [name="boatHull", c=.1, m=1, y=1]; definecolor [name="boatMast", c=.1, m=.5, y=.5, k=.3]; definecolor [name="boatMastLight", c=.1, m=.3, y=.3, k=.2]; definecolor [name="boatSail", c=0, m=.1, y=.3]; picture Boat; Boat := image( fill (0,60)---(34,55){dir 260}...{dir 280}(34,15)---(0,15){dir 70}...{dir 110}cycle withcolor "boatSail"; % left sail fill (36,55){dir 340}..{dir 280}(70,15){dir 170}..{dir 190}(36,15){dir 80}..{dir 120}cycle withcolor "boatSail"; % right sail draw (0,60)--(34,55) withcolor "boatMastLight" withpen pensquare; draw (0,15)--(34,15) withcolor "boatMastLight" withpen pensquare; draw (35,10)--(35,70) withcolor "boatMast" withpen pensquare scaled 2; % main mast fill (34,70)--(34,65)--(20,67)--cycle withcolor "boatHull"; % flag fill (0,10)---(35,10){dir 0}...{dir 45}(70,12){dir 270}...(55,0)---(7.5,0)--cycle withcolor "boatHull"; ); draw (0,0)--(OverlayWidth,0)--(OverlayWidth,OverlayHeight) withcolor white withpen pencircle scaled 0.01; for j=1 upto wavecount: definecolor [name="Sea", y=(j/20), c=2*(j/10), m=(j/20), a=1, t=.5]; %waveheight := (OverlayHeight/15)*((j+1)/(wavecount+1)); yoffset := waveheight/j/2; wave[j] := (0,yoffset)... for i=1 upto stops: (OverlayWidth*i/(stops+1), (yoffset) randomized (waveheight/2)) ... endfor (OverlayWidth,yoffset); %draw wave[j] withcolor "Sea"; if (j = wavecount-1): itime = (wave[j] intersectiontimes ((xpos,0)--(xpos,infinity))); iangle = direction (xpart itime) of wave[j]; boatpos = (point (xpart itime) of wave[j]) shifted (-boatwidth/2,-boatheight/20); % shift to center horizontally draw Boat xysized boatsize shifted boatpos rotatedaround (boatpos, angle iangle); fi fill ((0,0)--wave[j]--(OverlayWidth,0)--cycle) withcolor "Sea"; endfor; %draw Boat xysized (200,200) shifted (100,100); \stopuseMPgraphic \defineoverlay[Waves][\useMPgraphic{Waves}] \setupbackgrounds[state=repeat] \setupbackgrounds[page][background={Waves}] \starttext \dorecurse{10}{\recurselevel\page} \stoptext --------------iVVpDz4BBMmH0zmNFFUdwUlF Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --------------iVVpDz4BBMmH0zmNFFUdwUlF--