Go Down

### Topic: Potentiometers to 3d visualisation (Read 2589 times)previous topic - next topic

#### 444ed444

##### Dec 05, 2010, 01:34 pm
Hi i am working on an interactive furniture project. the concept is to create kinetic furniture that allows the user to communicate with virtual space. for this i have connected potentiometers to arduino (i am using 4 potentiometers) i am able to read the values of each potentiometer in the arduino serial port but i am having problems creating a 3d visualisation of this data. i would ideally like to start by using processing but could not find any similar projects where i could modify code and blender seems a bit complicated considering i am a beginner. i have created a 2d graph in processing using 1 potentiometer but i cannot figure out how to create a 3d visualisation using all 4 potentiometers. Please Help!

#### PaulS

#1
##### Dec 05, 2010, 01:58 pm
Quote
the concept is to create kinetic furniture that allows the user to communicate with virtual space.

What exactly is the user communicating with?

Presumably, and please correct me if I'm making any assumptions that are not in keeping with your unstated process, the data will be read by the Arduino, and sent to a PC.

Start by defining exactly what each potentiometer is going to do. Rotate about X? Rotate about Y? Rotate about Z? Zoom? Pan in X? Pan in Y? Pan in Z? To do all of these, you'd need as least 7 potentiometers.

Quote
i have created a 2d graph in processing using 1 potentiometer

What did the potentiometer control? X? Y?

Processing can be used to draw 3D objects, and manipulate the view of the object based on user (or serial) inputs. Look at the 3D + Camera + MoveEye example that rotates a cube based on the mouse position in Y. Extending that to rotate based on serial data would be trivial. Extending it to rotate in 2 directions based on 2 inputs is equally easy.

4 potentiometers is either more than you need, or less than you need. Whatever it is you need, though, you need to move the project from the art world to the engineering world. That involves requirements that can defined with your hands in your pockets.

#### 444ed444

#2
##### Dec 05, 2010, 02:24 pm
sorry
the objective of the project is to create furniture that enhances the experience of playing a game. i have chosen 1st person shooter games.

so potentiometer 1 - move forward and backward (1023 = forward 0 = backward along 'X') ideally a value of 512 means no movement.
potentiometer 2 - move side to side (1023 = right 0 = left along 'Y') again 512 is no movement

potentiometer 3 - rotate horizontal viewpoint 1023 = right 0= left 512 no movement
potentiometer 4 - rotate vertical viewpoint 1023 = up 0 = down 512 straight ahead ( no movement)

here is a link to video demonstrating how the first 2 potentiometers would communicate with the virtual space. (the potentiometers would be attached to the hinge)

so in processing a cube could represent a person and the potentiometers cause it to move along X and Y. rotating the viewpoint is going to be hard though??

#### u0421793

#3
##### Dec 05, 2010, 02:41 pm
I wonder whether the desire to create a 3d cubic representation of the controlling parameters: forward/backward; left/right; roll; yaw  (or is it pitch + yaw, or pitch + roll?) is actually a red herring. The cubic representation might turn out to be utterly superfluous in the end.

#### PaulS

#4
##### Dec 05, 2010, 03:43 pm
Quote
rotating the viewpoint is going to be hard though??

You have this backwards, I think. The geometry remains stationary. The only thing that changes is the viewpoint, and that is very easy to change. Think of the scene as holding still, and a camera moving around. Your only knowledge of the scene is through the lens of the camera. Moving the camera left and right/up and down/in and out/around various axes is easy. The math to compute the desired new camera position from the old camera position and the desired movement of the camera is hairy, but the actual movement of the camera is trivial.

The commands in Processing for defining geometry and moving viewpoints are very similar to those of OpenGL, leading me to guess that Processing's drawing abilities are based on OpenGL. There is a ton of information online for doing incredible stuff with OpenGL.