Re: [Pipmak-Users] File IO with Pipmak and image manipulation.
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2007-03-26 17:47:38
|
Andrea Viarengo wrote: > I need to write and to read info from external file, I tried standard Lue IO lib > without success: > > for line in io.lines(filename) do ... end > > and > > for line in file:lines() do ... end > > How I can do that? The Lua IO library (along with the OS library) has deliberately been left out of Pipmak - it's considered a feature that Pipmak projects are not able to mess around with a user's files. Can you explain what exactly you want to do? We might find a solution that meets both goals. Also, you always have the option of compiling your own version of Pipmak that includes the IO library. If the file you want to read lives inside the project and can be brought into Lua form, you could also use pipmak.dofile(). > Second one: > It would be difficult implement in pipmak a method to distort a patch in a > perspective manner? > That is, a function which deform a rectangular patch in a > trapezial one, > passing 4 arbitrary points that lie on the surface of a cubic face. That should be quite easy, given that Pipmak uses OpenGL. Well, perspective distortion would only work on panoramic nodes because on flat nodes the camera is orthographic - you'd have to live with linear distortion there. > Another useful method would be a function to crop a patch. That shouldn't be too difficult either. It might get a bit messy together with the support of rigid margins/stretchable center for patches on flat nodes that's already in SVN, but it should be manageable. What are you trying to do with that? Maybe it could already be done using two overlapping patches, one covering the portions of the other that you want cropped away? -Christian |