ksam
YaBB Newbies
Offline
Posts: 19
Surface library
Jun 14th , 2008, 1:02pm
I'd like to use the surface library mentioned in the Reference library, but unfortunately I get errors when I try to use libraries in Processing. I'm new in Processing and actually in programming altogether. I sincerely apologize if my questions are actually too easy or silly. I've spend days trying to figure out a program and I really hope your library can help me. But first I guess I'm clumsy with libraries. I asked about this in general in my post http://processing.org/discourse/yabb_beta/YaBB.cgi?board=LibraryProblems ;action=display;num=1213391592;start=0 But now I actually have specific beginner questions for the surface library. I put the unzipped surfaceLib under the directory of libraries in processing-0135. Then I just tried something. For example: import surface.calculation.*; import surface.*; import processing.xml.*; size(500,500,P3D); Surface(g, 10, 10, 0, 200, 0, 200, 1, 100); Sphere(g, 10, 10); I get the error 'Cannot find a function named "Sphere" with parameters processing.corePGraphics,int,int. 1) The program doesn't do anything. How do I get acces to the library and get for example a surface working? 2) It's also not very clear to me what I should do with i_parameter and i_color. And should the first parameter just be g? Am I wrong with the parameters? Does anyone have example code? 3) And another question: the surface function has x and y locations, but what if I wish to move vertices over the z-axis according to values of an array? Should I create a class or is there a standard solution? This is the idea: I intend to make a grid of vertices (x,y,z). The x and y remain at their positions, but z should vary according to a heightmap. Then I wish to put a texture over the surface. The user looks on top of the surface (in z-direction) so in 3D the areas that are placed higher seem larger on screen. Then when the mouse is dragged, the surface rotates. I just copied the source code from http://www.eskimoblood.de/applets/surface/applet3/surface3.pde into Processing and it gave me this error: Cannot parse error text s.setSurface(types[cnt]); Maybe this gives a clue about what's going wrong with my library access? I thought I might mail this as well, because I imagine that my description of how the library doesn't work is rather vague. I really need this program and I've been pondering over these things for days. It's actually for a research project. If you help me, it would be my pleasure to mention your advice in my article. Again, I apologize that these questions probably seem too easy. I really appreciate your help; it would save my project.