Pages: [1]   Go Down
Author Topic: Potentiometers to 3d visualisation  (Read 1274 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49453
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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??
Logged

London, GB
Offline Offline
Sr. Member
****
Karma: 8
Posts: 332
Nothing works.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 617
Posts: 49453
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paul
you are right the geometry would remain stationary and what would be moving would be the camera/viewpoint. there would not be a new position as such but the extreme values of the potentiometer (1023 and 0) would create constant movement along eg +X or -X. with acceleration increasing as the value gets closer to 1023 of 0.  i have seen similar projects on youtube but they are often the final outcome and no explanation of the process or code. do you know of any similar projects using analog inputs in arduino to influence camera movement in processing?
thanks
Logged

Pages: [1]   Go Up
Jump to: