POV-Ray : Newsgroups : povray.off-topic : Intelligence test Server Time
4 Sep 2024 17:22:21 EDT (-0400)
  Intelligence test (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Invisible
Subject: Intelligence test
Date: 19 Nov 2009 06:23:04
Message: <4b052a98$1@news.povray.org>
I'm using the following library:

http://cairographics.org/

Now, can *anybody* figure out what the default coordinate space is?!

Seriously, I can't find this information anywhere in the documentation. 
Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else? 
What??

It seems this is so trivial they forgot to actually write it down. >_<


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Intelligence test
Date: 19 Nov 2009 07:12:09
Message: <op.u3m5ijl47bxctx@e6600>
On Thu, 19 Nov 2009 12:23:03 +0100, Invisible <voi### [at] devnull> wrote:
> I'm using the following library:
>
> http://cairographics.org/
>
> Now, can *anybody* figure out what the default coordinate space is?!
>
> Seriously, I can't find this information anywhere in the documentation.  
> Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else?  
> What??
>
> It seems this is so trivial they forgot to actually write it down. >_<

The user space coordinate system depends on the device space coordinate  
system. By default, the mapping between them is an identity transformation.

I think most device spaces have (0,0) in the upper left corner, but I am  
not sure if that is a requirement or a coincidence.

No, I did not figure this out by reading the Cairo documentation, which  
seems to consist mostly of Doxygen-style pseudo-docs.



-- 
FE


Post a reply to this message

From: Invisible
Subject: Re: Intelligence test
Date: 19 Nov 2009 07:36:13
Message: <4b053bbd$1@news.povray.org>
Fredrik Eriksson wrote:

> The user space coordinate system depends on the device space coordinate 
> system. By default, the mapping between them is an identity transformation.

Yes. This much is stated explicitly.

> I think most device spaces have (0,0) in the upper left corner, but I am 
> not sure if that is a requirement or a coincidence.

For raster image formats (JPEG, PNG, GIF, TIFF...) this is true.

However, for both PostScript and PDF [the formats I'm actually 
interested in], the default origin point is actually the bottom-left 
corner, not the top-left.

In addition to this, both of these formats allow the coordinate space to 
be arbitrarily transformed. (Cairo provides the same functionallity 
itself as well, but PS and PDF have it natively.) So I'm not sure if 
Cairo is using the native defaults, or transforming them to match the 
other backends, or...?

> No, I did not figure this out by reading the Cairo documentation, which 
> seems to consist mostly of Doxygen-style pseudo-docs.

Yeah, it is a little... sparse?


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: Intelligence test
Date: 19 Nov 2009 07:45:26
Message: <op.u3m61zca7bxctx@e6600>
On Thu, 19 Nov 2009 13:36:13 +0100, Invisible <voi### [at] devnull> wrote:
>
> However, for both PostScript and PDF [the formats I'm actually  
> interested in], the default origin point is actually the bottom-left  
> corner, not the top-left.
>
> In addition to this, both of these formats allow the coordinate space to  
> be arbitrarily transformed. (Cairo provides the same functionallity  
> itself as well, but PS and PDF have it natively.) So I'm not sure if  
> Cairo is using the native defaults, or transforming them to match the  
> other backends, or...?

Then how about you just try it, and find out?



-- 
FE


Post a reply to this message

From: clipka
Subject: Re: Intelligence test
Date: 19 Nov 2009 08:05:47
Message: <4b0542ab$1@news.povray.org>
Invisible schrieb:

> Now, can *anybody* figure out what the default coordinate space is?!
> 
> Seriously, I can't find this information anywhere in the documentation. 
> Is (0,0) at the bottom-left corner? The top-left corner? Somewhere else? 
> What??
> 
> It seems this is so trivial they forgot to actually write it down. >_<

Experience indicates that everything that virtually all graphics output 
frameworks have (0,0) at the top-left corner - and the samples confirm 
that it is the case here as well.


Post a reply to this message

From: clipka
Subject: Re: Intelligence test
Date: 19 Nov 2009 08:13:05
Message: <4b054461$1@news.povray.org>
Invisible schrieb:

> In addition to this, both of these formats allow the coordinate space to 
> be arbitrarily transformed. (Cairo provides the same functionallity 
> itself as well, but PS and PDF have it natively.) So I'm not sure if 
> Cairo is using the native defaults, or transforming them to match the 
> other backends, or...?

Why not just... try it out?


Post a reply to this message

From: Darren New
Subject: Re: Intelligence test
Date: 19 Nov 2009 11:52:10
Message: <4b0577ba$1@news.povray.org>
Invisible wrote:
> It seems this is so trivial they forgot to actually write it down. >_<

That's OK. The graphics lib I'm workign with takes R, G, B, and A. And 
sometimes A=0xFF means opaque and sometimes it means transparent. And you 
get to guess for any given function whether A comes first in the list or last.

-- 
Darren New, San Diego CA, USA (PST)
   Is God willing to prevent naglams, but unable?
     Then he is not omnipotent.
   Is he able, but not willing, to prevent naglams?
     Then he is malevolent.


Post a reply to this message

From: Invisible
Subject: Re: Intelligence test
Date: 19 Nov 2009 11:57:56
Message: <4b057914$1@news.povray.org>
Darren New wrote:

> That's OK. The graphics lib I'm workign with takes R, G, B, and A. And 
> sometimes A=0xFF means opaque and sometimes it means transparent. And 
> you get to guess for any given function whether A comes first in the 
> list or last.

Wow, that's pretty sweet, man.

That's almost as good as the threadDelay function, that doesn't tell you 
whether the argument is seconds or miliseconds or picoseconds or...


Post a reply to this message

From: Darren New
Subject: Re: Intelligence test
Date: 19 Nov 2009 12:08:47
Message: <4b057b9f$1@news.povray.org>
Invisible wrote:
> That's almost as good as the threadDelay function, that doesn't tell you 
> whether the argument is seconds or miliseconds or picoseconds or...

Probably biliseconds.

-- 
Darren New, San Diego CA, USA (PST)
   Is God willing to prevent naglams, but unable?
     Then he is not omnipotent.
   Is he able, but not willing, to prevent naglams?
     Then he is malevolent.


Post a reply to this message

From: Orchid XP v8
Subject: Re: Intelligence test
Date: 19 Nov 2009 15:54:32
Message: <4b05b088$1@news.povray.org>
>> In addition to this, both of these formats allow the coordinate space 
>> to be arbitrarily transformed. (Cairo provides the same functionallity 
>> itself as well, but PS and PDF have it natively.) So I'm not sure if 
>> Cairo is using the native defaults, or transforming them to match the 
>> other backends, or...?
> 
> Why not just... try it out?

In the PostScript case, since Ghostscript insists on displaying every PS 
file under the assumption of A4 paper, it's hard to decide where Cairo 
thinks the edge of the paper is. PDF works correctly, however, and this 
indicates that Cairo is indeed translating and reflecting the coordinate 
system such that the origin is the top-left corner.

They could have saved me a whole heap of trouble if this were written 
down somewhere. (Note that it doesn't even say what the coordinate 
system is for image surfaces either...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.