Load textfile into array to display depth image

edited April 2017 in Kinect

Hey guys,

after watching some tutorials about the kinect I finally managed to get the depth image and transform that depth image into text/numbers. I have a textfile with a poem, just one for now, and I want that it picks random words to create something new. In my code I loaded the file, but instead of words it gives me numbers. Does anyone know what I do wrong?

Answers

  • we need the file (or a sample) in order to see what your code does with it.

  • Okay, this is what i get

    My image is made out of numbers instead of the text from the file which is this;

    Suizende stilte en het vredig schijnen
    der lamp in een vertrouwde woon
    hier moet de oude onrust wel verdwijnen
    en vindt het hart een beter loon
    
    Sneeuwjacht en stormwind zullen het belagen
    ik luister enkel naar de slag
    haars harten, verliefder nog na zoveel dagen
    dan eenmaal op de eerste dag
    
    Binnen de kleine kring van deze veste
    liggen de waarden, die ik won
    behoed voor hen die pogen een bres te
    stoten in dit hecht bastion. 
    

    In the end I actually want to add multiple poems and let it create a new one out of those in my image what you now see. The problem is thus that it doesnt select the words. Just numbers. Im thinking that I need to create an arraylist but im not sure.

  • Figured it out already :) Thanks anyway!

  • Glad you figured it out! I'm guessing that this line was the culprit:

    text(int(random(tokens.length)), x, y );
    
  • Haha yeah, the solution in the end was quite simple. Although I have another question. The text now shows up random within my canvas, is it possible to give this a fixed position? Like in this example:

Sign In or Register to comment.