Urs Holzer wrote:
> Is it possible to place patches at relative positions? For example,
> placing a patch at 40% from the left and 40% from the top. Using the
> parameters x and y, I have to provide the position of the patch in
> pixels. But I don't know the size of the images, I know only the
> relative positions. Is it possible to use nx and ny to do such a
> relative positioning?
On cubic nodes, yes. There the normalized coordinates go from -1 to 1,
independently of the image resolution. On slides and panels, not
directly - normalized coordinates are equal to pixel coordinates there,
there is no "relative" coordinate system.
> I don't really get what is written in the documentation.
Once you do get it, please let me know if you have any suggestions on
how it can be clarified.
> Perhaps using nz=1, nx and ny between -1 and 1 would work?
Yes. Just keep in mind that the edge of the cube face image does not lie
on the cube edge (at nx,ny = +-1), but half a pixel outside.
> Of course, I also could use image:size() to get the size of a side or a
> patch ...
Right, that's what I would suggest on slides or panels.
> Do you think the following has a chance to work?
> I render my patches with Povray using the partial rendering options
> StartColumn, StartRow, EndColumn, EndRow by giving relative coordinates
> (i.e. numbers between 0 and 1). Then I crop the images with
> ImageMagick, again giving relative coordinates. At the end, I place the
> patch in Pipmak using relative coordinates.
> I fear that this is doomed to result in ugly artifacts.
That should work, provided that you deal with the following: I assume
that both POV-Ray and ImageMagick round your relative numbers to whole
pixels. Pipmak doesn't do that. So you need to make sure that the
boundaries you give in relative coordinates already lie on pixel edges.
-Christian
|