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.
Page Index Toggle Pages: 1
'Fill' in 3D? (Read 762 times)
'Fill' in 3D?
Nov 17th, 2009, 8:50am
 
I'm making a model of a building using processing, but when I draw a shape (a slope whose gradient lessens in stages), but the fill seems to behave strangely, linking to verticies that it shouldnt..

I have commented out the rest of the image leaving just the roof, and highlighted the strokes to make it more obvious:
http://www.samhumphrey.co.uk/applet/building.html
Re: 'Fill' in 3D?
Reply #1 - Nov 17th, 2009, 9:17am
 
Hmmm... Most buildings usually have flat walls, so you would expect one of the 3 coordinates to remain consistent, either on the x,y or z axis depending on whether you're defining a wall (and which wall you're defining), floor or ceiling.

So in this case it looks to me like the y axis is more or less consistent so I changed it to:

Code:
beginShape();
 vertex(-15, -40, 40);
 vertex(25, -40, 20);
 vertex(35, -40, 110);
 vertex(130, -40, 90);
 vertex(110, -40, 5);
 vertex(80, -40, 5);
 vertex(85, -40, 65);
 vertex(65, -40, 70);
 vertex(50, -40, -10);
 vertex(-20, -40, 10);
endShape();


...and I get a nice flat shape that renders properly Smiley

When you're filling a shape in 3D you have to ensure it's a flat plane otherwise you see the rendering errors you experienced before.  With your building that should be easy enough as long as you ensure one axis is consistent - i.e. your walls are flat.  If you need to create curved shapes you'll have to break them down into triangles.

Obviously your wall looks a bit wonky at the moment.  I'd suggest mapping your building out on graph paper first: that should make it much easier to plug in the right coordinates to your vertices Wink
Re: 'Fill' in 3D?
Reply #2 - Nov 17th, 2009, 9:32am
 
there is a bezierShape tool. that helps you drawing your coordinates and import them directly into processing. http://processing.org/discourse/yabb2/?num=1252409430
Re: 'Fill' in 3D?
Reply #3 - Dec 2nd, 2009, 5:09am
 
Fantastic, I didnt realise anyone had got back to me on this one, thanks both for your help, I can finaly revisit my sketch!
Page Index Toggle Pages: 1