Am 19.11.2008, 23:09 Uhr, schrieb Christopher Barker  
<[EMAIL PROTECTED]>:

> Marcos Duarte wrote:
>> It is simple: for an image shown in the screen I just want to click on
>> an image point (pixel) and get the coordinates of that in meters,
>> using a given transformation I obtained before in a calibration
>> procedure (where I digitize points in an image I know the coordinates
>> in the real space),
>> What I meant is that I don't need to apply this transformation to the
>> image to produce its transformed bitmap (but if I can do that would be
>> nice).
>
> very similar to what I need to do. In my case, I need to work with
> raster maps -- the I don't want to warp the image at all, but I want to
> be able to work with the map in natural coordiantes . example:
>
> I load a raster map in the mercator projection. It is a big raster, and
> I want it displayed as is (except for zooming and shifting).
>
> But I want to be able to click on it and get the coordinates of the
> point in la-long, and be able to draw stuff on top of it in lat-long.
>
> I can provide the transform from pixel-> lat-long, and from  
> lat-long->pixel.
>
> So the trick is to draw the image itself untransformed, but everything
> else transformed (to match the image).
>
> My plan, with the old FC, was to have a "base layer" class. This class
> would provide the transform(and reverse transform) from "world"
> coordinates to "transformed" coordinates (and back). It would also
> optionally draw something, in this case an image. I can't just drop the
> image in as a regular object, because I don't want the transform applied
> to it, though it does still need to be zoomed and scaled to pixel
> coordinates.
>
> Matthias, can this be done with FC2?

Sure it can :-) You create the bitmap node and zoom and shift it. If you  
click on it, you perform the cartesian-to-lang/lat conversion on the  
event.coords.world coordinates. Then display those.
Then you can create all the other objects and apply the Mercator transform  
to them, see tutorial part 4.
Optionally you can create a single group, add all the other stuff to it  
and then apply the mercator transform to the group node. I don't know  
about the peformance implications of this approach however.

Oh, and I've checked in a new tutorial lesson, "Custom transforms". Shows  
how to plug-in your own transform, in the example it's a nice swirl  
transform.

-Matthias
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to