Skip to main content
3DTOPO
Inspiring
December 11, 2009
Question

Placed vs. Raster coordinates

  • December 11, 2009
  • 1 reply
  • 2851 views

Greetings,

I am struggling to understand the coordinate space for placed art objects. My code works perfectly for raster objects, but not for placed objects.

If I set the xy transform matrix to 0,0 the raster objects top left corner is positioned at the lower left of the artboard, and is what I need.

If I set the xy transfrom matrix to 0,0 for a placed object, it inverts the placed object (top becomes bottom) and puts it way up to the top right near the extents of the viewable bounds (no where near the art board).

Is there any documentation on placed objects coordinate space?

Or, can anyone recommend a way to position a placed object to 0,0 of the art board?

Seems like the two should use the same coordinates space - it is very confusing to me!


I appreciate any and all advice...

Thanks,

-jeshua

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
December 11, 2009

Heh, this is a problem I've run into before. I'm particularly fond of the whole 'upside and backwards in the upper right corner of the canvas' you get when you apply an identity matrix to kPlacedArt

Unfortunately, you've more or less already figured out what there is to know. If its kRasterArt, you do one thing. If its kPlacedArt, well, the origin and such is very different. In our code we simply have a nice fat if-statement that handles it differently depending on the type. If there's a better way to do it, I haven't found it. Frankly, the APIs in this department are a little old and not very user-friendly.

3DTOPO
3DTOPOAuthor
Inspiring
December 12, 2009

Since your if statement is handling it, any hint on how the coordinate space works?

Or is the only way to figure it out by trial and error?

A. Patterson
Inspiring
December 15, 2009

I could probably provide something, but it kind of depends on what information you're trying to get. In our plugin, we're just trying to position a raster in the correct position given some geospatial referencing. To that end, I found it easier to just 'start from scratch' -- I nullify the art's transformation and then build it up to where I want it to be from there. Figuring out where its at any given time was a problem I just didn't bother to solve; to date, in our plugin we just don't care where it is currently

If you're doing something like I'm talking about doing then I can help, but otherwise, yeah, you're probably looking at trial and error. One thing I've learned lately is that there are some objects (*cough*symbols*cough*) for which it is practically impossible to get an answer to the question "Where are you?".