 |
Author |
Topic: 3D Landscape (Read 1701 times) |
|
JohnG
|
3D Landscape
« on: Mar 23rd, 2004, 1:41pm » |
|
Made this a while ago, but I've had no time to come and share it: http://www.hardcorepawn.com/landgen3d/ Uses a fairly simple subdivide and displace generation routine (similar to 'Plasma' things I think) Move the mouse to rotate the landscape, and click to generate a new one. The image in the top left is a normalised version of the heightmap (max height = white), whereas the shown landscape uses absolute height for colour, hence you can get some mostly white landscapes in 3d, but nicely coloured heightmaps.
|
|
|
|
JohnG
|
Re: 3D Landscape
« Reply #1 on: Mar 23rd, 2004, 3:40pm » |
|
Now I've come back to Processing I can't put it down, I've gone and made a stereo-image version. http://www.hardcorepawn.com/landgen3d3d/ You need to stare somewhere behind your monitor screen to see it properly. It works on my monitor here, but I know different reolutions and screen sizes might make it impossible to see on some monitors.
|
|
|
|
JohnG
|
Re: 3D Landscape
« Reply #3 on: Mar 23rd, 2004, 4:00pm » |
|
I probably should make the colours a little more subdued, as well as putting in an option for lookthrough/crosseyed modes. (EDIT: done! Should all be nicely updated in terms of colours, an dhaving both viewing modes) Interesting idea for the sphere. Personally I'd go for a geodesic sphere, and subdivide and displace that. You start off with 2 4 sided pyramids stuckbase to base, then split each edge in the middle, so each triangle turns into 4, you move those new verticies to the average radius of the two parent ones, and then displace it a random ammount. Repeat as many times as necessary.
|
« Last Edit: Mar 23rd, 2004, 4:42pm by JohnG » |
|
|
|
|
TomC
|
Re: 3D Landscape
« Reply #5 on: Mar 24th, 2004, 9:31am » |
|
Hmm... I think you have some interface usability issues there madmerv It worked, but after a moment or two there wasn't much to see - it had drifted too much Hacked up a sperical landscape... not sure where to go with this, but here it is... http://www.tom-carden.co.uk/p5/spherical_landscape_2/applet/index.html
|
|
|
|
JohnG
|
Re: 3D Landscape
« Reply #6 on: Mar 24th, 2004, 1:41pm » |
|
on Mar 24th, 2004, 3:56am, madmerv wrote: what would be interesting if you did the same one but somehow did that fuzzy stereo imaging realtime (you know what i mean the black and white images that you cross your eyes to see) |
| I'm not entirely sure what you mean by fuzzy stereo imaging. It would be fairly trivial to change this from two full colour images to red/blue images for the paper glasses you get for such things.
|
|
|
|
TomC
|
Re: 3D Landscape
« Reply #7 on: Mar 24th, 2004, 3:17pm » |
|
I think he means random dot stereograms. Not sure how they're formed. Interestnig idea though. Update -- Google-fu: http://www.uclic.ucl.ac.uk/harold/sirds/ieee3d.pdf
|
« Last Edit: Mar 24th, 2004, 3:24pm by TomC » |
|
|
|
|
mm Guest

|
Re: 3D Landscape
« Reply #8 on: Mar 24th, 2004, 10:39pm » |
|
yeah that is what i meant
|
|
|
|
JohnG
|
Re: 3D Landscape
« Reply #9 on: Mar 24th, 2004, 11:03pm » |
|
on Mar 24th, 2004, 9:31am, TomC wrote: I just had to go and write something after I came up with the idea of subdividing a geodesic sphere, and it's worked out quite well: http://www.hardcorepawn.com/Planet/ Again it's in Stereo, with both view modes. hit any key other than space to increase the division level, but not too muhc or it'll seriously craw.. you get 4 times as many polys with each press.. taht ends up over 1/2 a million in just 8 presses...
|
« Last Edit: Mar 24th, 2004, 11:04pm by JohnG » |
|
|
|
|
mm Guest

|
Re: planetgen
« Reply #10 on: Mar 25th, 2004, 7:20am » |
|
that is pretty intense man. more like asteroids, but wow. what a difference a day makes. i thought maybe write a space conquest game eventually. still have trouble loading multiple meshes.
|
|
|
|
mm Guest

|
Circle drawing routine
« Reply #11 on: Mar 25th, 2004, 8:54am » |
|
add craters! Code: // Circle drawing routine // Using 8-way symmetry void Circle(int xcenter,int ycenter,int radius,color c) { int x=0; int y=radius; int p=(5-radius*4)/4; CirclePoint(xcenter,ycenter,x,y,c); while(x<y) { x++; if(p<0) {p+=2*x+1; } else{y--;p+=2*(x-y)+1;} CirclePoint(xcenter,ycenter,x,y,c); } } void CirclePoint(int cx,int cy,int x,int y,color c) { if(x==0) { set(cx,cy+y,c); set(cx,cy-y,c); set(cx+y,cy,c); set(cx-y,cy,c); } else if(x==y) {set(cx+x,cy+y,c); set(cx-x,cy+y,c); set(cx+x,cy-y,c); set(cx-x,cy-y,c); } else if(x<y) {set(cx+x,cy+y,c); set(cx-x,cy+y,c); set(cx+x,cy-y,c); set(cx-x,cy-y,c); set(cx+y,cy+x,c); set(cx-y,cy+x,c); set(cx+y,cy-x,c); set(cx-y,cy-x,c); } } void setup() { size(512,512); } void loop() { Circle(int(random(1)*width), // x int(random(1)*height), // y int(random(1)*((width+height)/2)), // radius color(int(random(1)*255),int(0),int(0))); // color } |
|
|
|
|
|
ouoertheo
 

|
Re: 3D LandscapeI must say the stereo
« Reply #12 on: May 30th, 2004, 12:00am » |
|
I must say the stereo mode is simply genius, not to mention awesome, you have inspired me to make a video game using that technique.
|
|
|
|
|