|
Author |
Topic: Symmetric solids (Read 625 times) |
|
Ale_k
|
Symmetric solids
« on: Aug 11th, 2003, 4:26pm » |
|
Hi, this is a (rough) study to build symmetric solids. It's still a work in progress, anyway in the future I would like to create some classes. Press 'A' or 'Z' keys to increase or decrease sides number. http://www.ghostagency.net/processing/_3Dprimitive_1a/ Alessandro
|
|
|
|
mKoser
|
Re: Symmetric solids
« Reply #1 on: Aug 11th, 2003, 6:08pm » |
|
great work from a useability point of view, i think it would be nice if you could turn rotating (according to mouse location) on/off, so that you could choose a perspective to view from, and then play with the handles without loosing that perspective! - mikkel
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
Ale_k
|
Re: Symmetric solids
« Reply #2 on: Aug 11th, 2003, 6:19pm » |
|
Yes, you are right, I will do. Alessandro
|
|
|
|
vent
|
Re: Symmetric solids
« Reply #3 on: Aug 16th, 2003, 8:48pm » |
|
nice work. Are you planning on doing a loft primative as well?
|
http://www.shapevent.com/
|
|
|
Ale_k
|
Re: Symmetric solids
« Reply #4 on: Aug 17th, 2003, 5:34pm » |
|
Hi, here it is, actually just basic function but I'm still working on it : class Solid { // ArrayX and ArrayY define solid profile, Sides the sides number int[] ArrayX; int[] ArrayY; int Sides; // int i; int Sy,Sy1,Sx,Sx1; int arraycont; int highProj,lowProj; int point1,point2; int high; float beta1; float d; // Solid (int[] xnum,int[] ynum,int snum ) { ArrayX=xnum; ArrayY=ynum; Sides=snum; } void update () { d= 0.0; while(d < TWO_PI) { rotateY(TWO_PI/Sides); push(); arraycont=ArrayX.length-1; for (i=0;i<arraycont;i++){ Sy1=Ynumbers[i+1]; Sy=Ynumbers[i]; Sx=Xnumbers[i]; Sx1=Xnumbers[i+1]; push(); translate(0,-Sy1,Sx1); point1=int(Sx1*tan(PI/Sides)); point2=int(Sx*tan(PI/Sides)); highProj=Sy1-Sy; lowProj=Sx1-Sx; beta1=atan2(lowProj,highProj); high=int(sqrt((highProj*highProj)+(lowProj*lowProj))); rotateX(-beta1); quad(point1,0,-point1,0,-point2,high,point2,high); pop(); } pop(); d +=TWO_PI/Sides; } } void updateData(int[] xnum,int[] ynum,int snum){ ArrayX=xnum; ArrayY=ynum; Sides=snum; update(); } } For example, to initialize the istance: int[] Xnumbers = { 100,15,15, 10, 10 , 20, 10, 70, 80, 150 }; int[] Ynumbers = { -190,-170,-50, -20, 0, 20, 60, 100, 120, 190}; int q=8; Solid new_solid=new Solid(Xnumbers,Ynumbers,q); and new_solid.update(); or new_solid.updateData(Xnumbers,Ynumbers,q); Bye Alessandro
|
|
|
|
twitch
|
Re: Symmetric solids
« Reply #5 on: Aug 29th, 2003, 6:57am » |
|
Very excellent Alessandro, very nice. While I acknowlege and greatly appreciate the purity and simplicity of the interface (this is really nearing software-as-art in its austerity and elegance), I confess to a certain yearning for some utilitarianism. The suggestions of mKoser make a certain amount of good sense, for instance. Also, I am curious, how would you go about making the applet store, to disk or url, say, an object created in this way? Perhaps it would be possible to incorporate tool interfaces that would not interfere with the presentation or level of participation in the artistic process? Again, very nice! Be Well, James (twitch)
|
http://mw.merseine.nu/~twitch/newmw/
|
|
|
Ale_k
|
Re: Symmetric solids
« Reply #6 on: Aug 31st, 2003, 10:23am » |
|
Hi, thanks mKoser,zevan,twitch. I never think this applet as an application or an "artistic work" but just a way to show how to build a constructor for 3d object, anyway I'm sure there are better ways to do that . In the future I will applicate it in a more complex work, thanks for the useful suggestions. Bye Alessandro
|
|
|
|
|