We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › How can I make something like a 3D map
Page Index Toggle Pages: 1
How can I make something like a 3D map (Read 391 times)
How can I make something like a 3D map
Apr 29th, 2008, 8:28am
 
Hey!
I'm wondering how I can code something generative that looks like a 3D map. Go here to understand what I mean Wink

http://www.notforcommercialuse.com/index.php?img=64&dir=.

It looks like a complex 3D model whose outlines are drawn individually for every z-layer. But I just don't know how to realize it. Maybe someone's got a hint?

Thx A.P.
Re: How can I make something like a 3D map
Reply #1 - Apr 29th, 2008, 9:36am
 
I don't believe that this is 3d. A simple solution is to use points on a bezier curve (http://processing.org/reference/bezierPoint_.html) and adding a little noise to it. This is a little non tested example of my idea.

Code:

bezier(85, 20, 10, 10, 90, 90, 15, 80);
ellipseMode(CENTER);
int lastX=85;
int lastY=20;
int steps = 10;
for (int i = 0; i <= steps; i++) {
float t = i / float(steps);
float x = bezierPoint(85, 10*noise(t), 90*noise(t), 15, t);
float y = bezierPoint(20, 10*noise(t), 90*noise(t), 80, t);
line(lastX, lastY,x, y);
lastX=x;
lastY=y;
}
Page Index Toggle Pages: 1