hi, I'm trying to import 3d coordinates from grasshopper but I just cant figure it out. I have tried to search in the forum, and both the gHowl and UPD Lib examples, and so far this is what i have. But I'm stuck with NullPointerExceptionAny thoughts? If someone has an example of multiple points transfer from GH to processing that would be rather helpful. Thanks in advance for any help
- import hypermedia.net.*;
- UDP udpr;
- String message;
- ArrayList nodesGH = new ArrayList();
- void setup() {
- udpr = new UDP( this, 600);
- udpr.listen( true );
- String lines[] = split(message, ']');
- // println(lines.length);
- for(int i = 0; i<lines.length; i++){
- if (lines[i].startsWith("#")){
- float values[] = float(lines[i].split("#")[1].split( ","));
- // nodesGH.add( new Node(values[0], values[1], values[2]) );
- }
- }
- }
- void draw(){
- }
- void receive( byte[] data, String ip, int port ) {
- data = subset(data, 0, data.length);
- message = new String( data );
- // print the result
- println( "receive: \""+message+"\" from "+ip+" on port "+port );
- }
- class Node{
- Ball(float x, float y, float z){
- println( " generated new Ball: "+ x +", "+y+", "+z);
- }
- }
1