naffets77
YaBB Newbies
Offline
Posts: 2
rotation, buttons, lots of fun stuff
Feb 26th , 2006, 7:00am
Hey, I'm brand new to processing, I know a decent amount of java (not much graphics stuff yet though...) and i'm trying to write a program where i have a rotating house that has windows that act as buttons. Going through the examples i was able to create a house with the RGB example, by modifying the code.. and then i changed the rotation so that it would rotate with if(mousePressed){rotate(a)}. My first problem and i've looked through all the forums becuase I figured this must be pretty trivial.. maybe it's not is that when i run the program it has my 3d house at it's initial position, and then when i click the mouse it rotates nicely but then when i unclick it goes back to that initial position. How do i make it stay at where it had rotated too? I havent been able to find an example of this, and I figure it's got to be pretty easy and common to do. One other thing, is that all i've done so far is to create my 3d house and got it rotating. Is this the right way to do it, if i want to add basically doors and windows that can be clicked on to do things( i.e. bring up a more detailed information about blah object in some other frame) I don't know yet how difficult or if it's even possible to add stuff to my house. Thanks for any help... this is basically what i got atm float a = 0.0; void setup() { size(600, 600,P3D); fill(204, 204); framerate(45); colorMode(RGB, 1); } void draw() { background(0.5, 0.5, 0.45); a += 0.01; translate(width/1.8, height/2); if(mousePressed){ rotateY(a); } scale(60); beginShape(QUADS); ~ lots of vector stuff for house ~ endShape(); }