eskimoblood / surfacelib

:shell: create different 3d surfaces in processing
10 stars 5 forks source link

all constructors seems undefined #1

Open gghh opened 9 years ago

gghh commented 9 years ago

Hello, I have installed the library, but even the snippet

import surface.*;
Sphere s;

void setup(){
  s=new Sphere(g, 10, 10);
}

gives me The constructor Sphere(PGraphics, int, int) is undefined. What am I missing?

gghh commented 9 years ago

forgot to mention:

heliotropeRD commented 9 years ago

Same.

Kayzh3r commented 9 years ago

same error

JorgeVelez commented 9 years ago

Same here. Does anyone have a tip on how to fix this?

shiyamon commented 9 years ago

I got the same error and found the reason. The problem is not the library itself but examples. It seems the construction of this library has been changed on porting to Processing 2.x. but examples stayed old.

I have succeeded to run "draw" example with changing the source code as below.

  1. change the first argument of each surface class from "g" to "this" for example, s = new Sphere(this,resolution,resolution);
  2. Surface class doesn't have draw function but now it returns PShape instead. So, for drawing surface you can use shape(s.getSurface());

Gotcha!!

Anyway, I hope the author will replace all examples anytime soon :)

eskimoblood commented 9 years ago

Sorry but I'm not working on this anymore, but you can make a pull request to fix the issue.