Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #891
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.postscript |
| Subject | Re: ping luser- -droog: SVG or PS project for you? |
| Date | 2012-08-18 00:14 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <3d013aa0-e8c0-4db9-8a03-ed29b2eba2cf@googlegroups.com> (permalink) |
| References | <1ca6lvkhx25dt.14pkcuyecuct2$.dlg@40tude.net> <b578b27d-5292-4e14-9bea-51c334034ea6@googlegroups.com> |
On Saturday, August 18, 2012 1:40:51 AM UTC-5, luser- -droog wrote:
> On Tuesday, July 17, 2012 3:48:33 AM UTC-5, tlvp wrote:
>
> > I'm not sure whether you're up to taking on others' tasks, but here's a
>
> >
>
> > geometrical one my own PS and/or SVG capabilities just aren't up to at all.
>
> >
>
> >
>
> >
>
> > I'd like to find code for getting 2D-projected views of the 3D object
>
> >
>
> > whose x- and y- and z-coordinates (after suitable scaling, say) satisfy:
>
> >
>
> >
>
> >
>
> > : Max [ x^2+y^2, x^2+z^2, y^2+z^2 ] = 4 (-2 <= x&y&z <= +2) .
>
> >
>
> >
[snip]
>
>
>
> Alright, version 1 has some obvious flaws.
>
> But it looks really strange.
>
> I think I should solve for z instead of sampling.
>
> And there's no projection here, just dropping the z
>
> (interpreting it as a grey value).
>
>
>
> I borrowed heavily from my mandelbrot set program
>
> in the use of `image`.
>
Forgot to clear the bytes, so it was smearing.
Now it uses 128 for a mid-grey background.
And a little fuzzy on the notion of equality
starts to bring it to life, I think.
%!
/oldeq /eq load def
/eq {
ceiling exch ceiling oldeq
} def
/max {
2 copy lt { exch } if pop
} def
%x y z f bool
/f {
dup mul 3 1 roll %z^2 x y
dup mul 3 1 roll %y^2 z^2 x
dup mul 3 1 roll %x^2 y^2 z^2
2 index 2 index add %x^2 y^2 z^2 x^2+y^2
3 index 2 index add %x^2 y^2 z^2 x^2+y^2 x^2+z^2
3 index 3 index add %x^2 y^2 z^2 x^2+y^2 x^2+z^2 y^2+z^2
max %x^2 y^2 z^2 x^2+y^2 max(x^2+z^2,y^2+z^2)
max %x^2 y^2 z^2 max(x^2+y^2, max(x^2+z^2,y^2+z^2))
4 1 roll pop pop pop %max(...)
4 eq
} def
/tlvp {
/dep exch def %depth
/res exch def %resolution
/str res string def %1-row buffer
/++ { dup load 1 add store } bind def %increment proc
/yc 0 def %y cursor
res res 8 [ res 0 0 res neg 0 res ]
{ %image
0 1 res 1 sub { %for each byte of the string, incr x
/xc exch def %x cursor
/x0 xc res div 4 mul 2 sub def %
/y0 yc res div 4 mul 2 sub def %
str xc 128 put
0 1 dep 1 sub { %check all z values in range
/zc exch def
/z0 zc dep div 4 mul 2 sub def
x0 y0 z0 f {
str xc
z0 2 add 4 div 255 mul cvi
put
} if
} for
} for
/yc ++ %incr y for next row
str %yield string buffer to `image`
} image
} def
0 150 translate
612 612 scale
100 100 tlvp %x&y z don't push it with these, it's O(n^3)!
showpage
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar
ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-17 04:48 -0400
Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-07-17 08:16 -0700
Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-07-17 19:25 -0400
Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-08-17 23:40 -0700
Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-08-18 00:14 -0700
Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-18 22:44 -0400
Moire Madness! Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-08-23 13:00 -0700
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-24 01:45 -0400
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-24 01:49 -0400
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-08-23 23:11 -0700
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? luser- -droog <mijoryx@yahoo.com> - 2012-08-23 23:58 -0700
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-25 02:17 -0400
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? Luser droog <mijoryx@yahoo.com> - 2012-08-29 18:25 -0500
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? Luser droog <mijoryx@yahoo.com> - 2012-08-29 21:32 -0500
Re: Moire Madness! Re: ping luser- -droog: SVG or PS project for you? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-08-30 05:26 -0400
Hula-Hoop Hullaballoo! Re: ping luser- -droog: SVG or PS project for you? Luser droog <mijoryx@yahoo.com> - 2012-09-02 16:04 -0500
Re: Hula-Hoop Hullaballoo! Re: ping luser- -droog: SVG or PS project for you? Luser droog <mijoryx@yahoo.com> - 2012-09-03 12:29 -0500
Re: Hula-Hoop Hullaballoo! Re: ping luser- -droog: SVG or PS project for you? Luser droog <mijoryx@yahoo.com> - 2012-09-04 12:04 -0500
Re: Hula-Hoop Hullaballoo! Re: ping luser- -droog: SVG or PS project for you? "M. Joshua Ryan" <mijoryx@yahoo.com> - 2012-09-04 12:49 -0500
A shaded cylinder luser- -droog <mijoryx@yahoo.com> - 2012-09-04 18:11 -0700
Re: A shaded cylinder luser- -droog <mijoryx@yahoo.com> - 2012-09-11 13:03 -0700
Spinning Steinmertz Solid (approx.) luser- -droog <mijoryx@yahoo.com> - 2012-09-11 21:29 -0700
Mulligan (again) luser- -droog <mijoryx@yahoo.com> - 2012-09-13 19:07 -0700
Re: Mulligan (again) tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-09-14 05:05 -0400
Heineken time "luser.droog" <luser.droog@gmail.com> - 2012-09-15 16:50 -0500
Bigger and Badderer "luser.droog" <luser.droog@gmail.com> - 2012-09-16 23:33 -0500
Re: Bigger and Badderer "luser.droog" <luser.droog@gmail.com> - 2012-09-16 23:37 -0500
QapplaH! "luser.droog" <luser.droog@gmail.com> - 2012-09-17 11:34 -0500
Re: QapplaH! (appendix: updated mat.ps) "luser.droog" <luser.droog@gmail.com> - 2012-09-17 13:05 -0500
one more cup of coffee for the road. "luser.droog" <luser.droog@gmail.com> - 2012-09-18 02:51 -0500
Re: Bigger and Badderer tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-09-18 21:52 -0400
Re: Bigger and Badderer "luser.droog" <luser.droog@gmail.com> - 2012-09-18 22:30 -0500
Re: Bigger and Badderer tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-09-19 00:59 -0400
Re: Bigger and Badderer "luser.droog" <luser.droog@gmail.com> - 2012-09-19 00:48 -0500
Revolving Camera prototype "luser.droog" <luser.droog@gmail.com> - 2012-09-23 22:30 -0500
Steinmetz with Revolving Camera "luser.droog" <luser.droog@gmail.com> - 2012-09-24 09:30 -0500
csiph-web