I'm baaaaaack! (With a new graphics project)
Posted: 10 Sep 2012, 03:44
Hey, I'm back
After a long absence due to college, life, etc. I had an idea today and was, for once, able to sit down and code the whole thing in two sittings.
I coded the proof-of-concept all at once, and technically wasn't even at my computer; I was at my church running the projection systems and remotely logged in to my computer through the LogMeIn app on my iPod touch. (I highly recommend this app to anyone and everyone who has an iProduct running iOS!!!) So using the little Retina Display I pulled up BricxCC and started punching in bits of code until I (as usual) ran into something I wasn't sure about.
I needed a way to draw a line on the screen from Point A to Point B. I knew how to draw lines already, but that's assuming I already have a value to feed into the Point x/y coordinates. I wanted random data in those, however, but I wanted a random number in the range of the screen dimensions. Now, I could easily have done this in NXT-G (*shudders*) but I really was curious as to how I could do it in NXC. I figured something along the lines of Random(99) would give me a number between 0 and 99, and it did. Worked great.
In fact I had it render two lines, with an end from each line connected, so as to (usually) form an angle. This was the other thing I needed to learn about: keeping rendered lines connected. After a bit of thinking I realized this could be accomplished by forming 6 variables: an X/Y pair for Point A, an X/Y pair for Point B, and an X/Y pair for Point C; then I could use Points A and B for the start and end of Line 1, and Points B and C for the start and end of Line 2. It worked like a charm and I ended up with this:
[youtube]www.youtube.com/watch?v=mUhU--RXQCo[/youtube]
After working out the few little kinks found in such a tiny simple program, I made this:
[yt]http://www.youtube.com/watch?v=6mluL1EbhR4[/yt]
I really like how it turned out. I'm going to attempt to use this for performances of music and visuals, most likely having the abstract data (which is being visualized by the bezier) converted into motor movements, which will move mirrors and reflect a laser beam. Or two.
I also think that I should be able to tweak the code so that I can, say, twist the knob of a motor and have the NXT read that data and make the bezier have more or less points, relevant to which way I turn the knob, and that sort of thing. I really want to just splice some cables and make an audio input jack to use instead of the microphone or light sensor, but I have a feeling I should really use optoisolators for that, just to be safe.
Any thoughts on the videos, concept, or anything at all would be greatly appreciated. The thing artists need most is feedback! I might try to make a video with a soundtrack, with the bezier synced with/controlled by the song playing. That's probably far off, though, as I'm quite deep in a few other projects, including making the music to use for such things XD
Also, I know this is already a long post but I have to say: it's good to be back. Even if I'm just popping my head in here to read the last 25 forum threads and make a post, it really makes me feel so much better to be doing what I used to enjoy doing! ^_^
After a long absence due to college, life, etc. I had an idea today and was, for once, able to sit down and code the whole thing in two sittings.
I coded the proof-of-concept all at once, and technically wasn't even at my computer; I was at my church running the projection systems and remotely logged in to my computer through the LogMeIn app on my iPod touch. (I highly recommend this app to anyone and everyone who has an iProduct running iOS!!!) So using the little Retina Display I pulled up BricxCC and started punching in bits of code until I (as usual) ran into something I wasn't sure about.
I needed a way to draw a line on the screen from Point A to Point B. I knew how to draw lines already, but that's assuming I already have a value to feed into the Point x/y coordinates. I wanted random data in those, however, but I wanted a random number in the range of the screen dimensions. Now, I could easily have done this in NXT-G (*shudders*) but I really was curious as to how I could do it in NXC. I figured something along the lines of Random(99) would give me a number between 0 and 99, and it did. Worked great.
In fact I had it render two lines, with an end from each line connected, so as to (usually) form an angle. This was the other thing I needed to learn about: keeping rendered lines connected. After a bit of thinking I realized this could be accomplished by forming 6 variables: an X/Y pair for Point A, an X/Y pair for Point B, and an X/Y pair for Point C; then I could use Points A and B for the start and end of Line 1, and Points B and C for the start and end of Line 2. It worked like a charm and I ended up with this:
[youtube]www.youtube.com/watch?v=mUhU--RXQCo[/youtube]
After working out the few little kinks found in such a tiny simple program, I made this:
[yt]http://www.youtube.com/watch?v=6mluL1EbhR4[/yt]
I really like how it turned out. I'm going to attempt to use this for performances of music and visuals, most likely having the abstract data (which is being visualized by the bezier) converted into motor movements, which will move mirrors and reflect a laser beam. Or two.
I also think that I should be able to tweak the code so that I can, say, twist the knob of a motor and have the NXT read that data and make the bezier have more or less points, relevant to which way I turn the knob, and that sort of thing. I really want to just splice some cables and make an audio input jack to use instead of the microphone or light sensor, but I have a feeling I should really use optoisolators for that, just to be safe.
Any thoughts on the videos, concept, or anything at all would be greatly appreciated. The thing artists need most is feedback! I might try to make a video with a soundtrack, with the bezier synced with/controlled by the song playing. That's probably far off, though, as I'm quite deep in a few other projects, including making the music to use for such things XD
Also, I know this is already a long post but I have to say: it's good to be back. Even if I'm just popping my head in here to read the last 25 forum threads and make a post, it really makes me feel so much better to be doing what I used to enjoy doing! ^_^