I've got a 3d data viz sketch that I want to put on a web page using processing.js. Unfortunately, this means that peasy cam is out. I've created a simple camera on weak springs setup that sort of moves around the scene, but I want to display text that always faces the camera. With peasy, this is really easy with the getRotations() function. I was hoping that there was a simple way to get this from the processing camera, but it appears that there isn't, and i've run into a world of quaternions and matrices and euler angles.
Can anyone explain to me how I can find the correct rotation angles? I've looked at the peasy code and it's just a little beyond me.
Information that I have in the sketch to work with is the camera setup information (eye position, lookat position, up vector). Shouldn't this be enough to calculate the angles?
What's the role of Computational Design in Industrial Design?
A series of experiments in how we might design physical objects with code.
Tell me what you think!
So this one searches twitter for a particular word or phrase, turns the results into blocks and then adds them to the "table". It uses
twitter4j, a java implementation of the twitter api. To use this, you need to get a developer application key from twitter. It's free. I'm working on a web version that will use processing.js that won't need the key.
I am attempting to sort a HashMap based on the Value. I want to use the most frequent words in a text. First I have to count them (which I can do), then I have to sort them by their number (which isn't working).
I've found several things that touch on it, and I think I'm very close, but it's not exactly working.
If you run the code you'll see that the 'sortHashMap' function is sorting them properly, but when I print the sortedMap, it's no longer sorted. Is there something with the .put function that I'm not realizing?
Thanks for looking.
p.s. - you'll also need some sort of text file.
HashMap newWords; // HashMap object
HashMap sortedWords;
HashMap countedWords;
String[] newTokens; // Array of all words from input file
String[] commonTokens; // Array of all words from input file
My name is Justin Couch and I am getting my Masters Degree in Industrial Design at RISD. I am enamored with and fascinated by Computational Design in all of its forms, but I am obviously particularly interested in its use in Industrial Design (i.e. product design). It is currently being used by only a select few object makers and one of my goals during my time here at RISD is to a) explore my own personal use of Computational Design in the design of products and b) show that it is a powerful tool that more IDers should be figuring out how to use.
So I'm going to be posting a lot of my experiments and work here and I would love anyone and everyone's feedback. If you know of people I should check out, if you have ideas on what I should try, or if you have suggestions on how I can improve my code, etc., please let me know.
So basically I'm just a designer who knows a tiny bit about coding and I'm trying to make cool things.
Here's to something cool happening!
Justin Couch
So my first examination of the topic is based on Experimentation. I want to see if I can quickly generate an idea, prototype something in code, get something that is just decent enough to call a result, and then move on. I'm not looking to make finished products or elegant code (for now). So here goes:
First experiment: Keyboard Morphing
What would it look like if your keyboard changed as you typed? What if the keys you used got bigger and stronger and the ones you didn't got smaller and weaker? What if you could type on a keyboard that represented the works of Shakespeare or Dickens?
So, a quick exploration of text and shape change.
This sketch uses the traer physics library found
here.
The program reads a text file and changes the key sizes accordingly.
Shakespeare's Sonnets
Moby Dick
Nervous System's Cell Cycle Code
And here's the code.
import traer.physics.*;
import processing.pdf.*;
boolean saveOneFrame = false;
String [] lines;
PFont font;
ParticleSystem psys = new ParticleSystem(0, 0.95);
I've set up an ArrayList of Node class objects. I'm running a simple for loop to grab each one, but when I run this:
Node nm = (Node) nodes.get(m);
if's giving me a ClassCastException saying that PVector cannot be cast into Node. The problem is that I'm not casting PVector and Node is not holding a PVector.
The other strange part is I have almost the exact same line of code about 10 lines before:
Node nodej = (Node) nodes.get(j);
and it works just fine.
I know it's hard to give me a specific answer without all of my code. I can dump it here if I need to, but I was just hoping for a first stab at why this might be.
Also, I can call specific Node objects. If I change the "m" to a number : nodes.get(0), it works. What gives?