Grasshopper

algorithmic modeling for Rhino

hey everyone,

I want to control a rhino-view-camera by the movement of a wii-nunchuck. I get the values from the wii over an arduino (all buttons, accelerators and joystick) and want to use them now for camera movement. 
the first problem is that I can only move an object relative to the values I get (means that when there are values from -1 to 1 this would be the whole range of movement). what I want to do is to add all values steady so that I can have an absolute movement of my object.
second problem is that there are no camera objects in grasshopper yet. is there a possibility to do it with .net?

thank you

Views: 959

Replies to This Discussion

the value issue is not a big one, just modify to the range you need...yes, it is possible to move 'cameras' within a .net component...google search the vb & c# area for some examples...
hey Luis,

thank you for your quick reply. I think the problem of the range is more complex. the grasshopper definition updates the wii-values each 50 ms, so I get a single integer value each time. imagine you want to move the camera for 5 seconds straight forward - then you have to add all incoming values and that every 50 ms. so your movement becomes absolute and is not limited to a definded range.
because of that I need a variable that is growing or at least changing every time the definition gets updated, a resulting value consisting of all values that came in since the definition was started.
any ideas?
this sounds interesting!
For camera movement, take a look at the post on my blog entitled "How to Make a Line go Crazy". The definition that was used for that animation does pretty much about all you'd want for camera movement (camera and target locations, focal length, camera roll). The definition is available for download at the end of the post
thank you damien, I will have a look at your definition... by the way, nice blog!
damien,
I tested your definition, really nice work! it seems that camera controlling is not that difficult in .net (if you are not a total newbie like me). in your definition you flow along defined paths to evaluate the camera position and target. in my case it would be no problem to feed your .net component with calculated points, right?
what I want to say is that I just need to translate the wii-movements into point coordinates and put them into your .net component.
...thank you, now I am one step closer...
Yea, its not that hard if you know where to look ;) Also, using the active viewport makes it fairly easy as well.

I really can't say exactly what you need because I'm not really certain how your data is coming in. Camera location is going to need a point. The target location/camera direction as well as the camera Z need to be expressed as a vector. I think in my component I just created the vector for the camera direction on the fly from the camera location and the target location.
my data consists of a string like this: 123,200,30,0,0,100,214
the first three values are the x,y and z accelerators of the wii, the 0,0 are the two buttons and the last two numbers are the joystick axis. I took the definition and the library from andrew payne from liftarchitects (http://www.liftarchitects.com/) and adjusted it to my needs. he wrote a vb-listener, that reads the values from the wii connected by an arduino and feeds it into grasshopper, every 50 milliseconds. what he did now is to split the string in several single strings, that I again turned in values between -1 and 1.
what I need now is a method to add all the incoming values for each movement of the wii in grasshopper for getting an absolute camera movement. but as I am not able to create a grasshopper-component that adds the latest value to the former ones - every 50 ms I don´t know how to proceed.
any idea?
As you said, you will need to to sum up/add/accumulate all x,y and z values from the wii separately. this means adding deltas (relative changes) to absolute coordinates. you can use "compose point" to generate points from the xyz values.

i am not sure how to accumulate values and i am not in front of gh right now. maybe there is a function Inside the fx component...
hi Core. Oops. i replied before reading your answer. i remember an accum(ulate) function from max/jitter. did you check the "Display function List" Button in fx editor.
damien, your .net component is working fine. I simulated my wii-movements with grasshopper sliders and it works great. thank you for that!

frankS, thanks for your suggestion. I will try it now! I wonder if I have to connect the 50 ms component to whatever accumulation component...?
Core,

Give [Mass Addition] a try. It sounds like what you're describing...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service