[Visinfo] animation algorithm questions?

glegrady legrady at arts.ucsb.edu
Mon Jan 30 22:40:27 PST 2006


hi Mike,

Not being a computer science expert, I checked with Rama Hoetzlein, my  
CS trained MAT former TA. Probably Angus would have been able to answer  
these as well.

His answers:

The decision to use an array, ArrayList or Vector class really depends  
on the application. These different structure vary in terms of the way  
they handle memory. Some do not allow addition or remove (arrays, which  
are fixed in memory), some allow immediate insertion but slow deletion  
of objects (linked lists, ie. ArrayList) while others allow slow  
insertion and deletion but fast searching (Vectors). This site may help  
you decide:  
http://www.javaworld.com/javaworld/javaqa/2001-06/03-qa-0622- 
vector.html
If you want to look into these differences further, I would recommend a  
computer science book on Java data structures.

Syntax for 2D vector type arrays: Look it up. There are many Java books  
at the library.

 > Also I would like input into general object/class organization - the  
animated critter is an object, but are each of his legs as well?
I presume this is a code design question, ie. how to make an animated  
critter in which body and legs are both objects/classes. This can be  
accomplished with classes. An object is an "instance" of a class, just  
as a cat is an "instance" of an animal (animal describes a whole class  
of creatures). For example, you might make a "bodyobj" class which also  
has a reference to the parent object. Then you can make 5 objects, 1  
'bodyobj' for the whole critter and 1 for each leg.

critter (bodyobj, no parent object)
    left_front_leg (bodyobj, critter is parent object)
    right_front_leg (bodyobj, critter is parent object)
    left_back_leg (bodyobj, critter is parent object)
    right_back_leg (bodyobj, critter is parent object)

Again, a library book on Object-Oriented Java Programming should cover  
this.

Regarding data...
 > Seems like a trade-off between extendability (that is if there is a  
lot of preprocess it'll be harder for me to pull down other datasets  
and feed them right into the visualization program) and ease of  
coding...
This is exactly right, it is a trade off. In general it depends on how  
flexible you want your input reader to be. If you want to put together  
something quickly, then figure out the "easiest" way to read data into  
processing, possibly by reading csv data, and then modify your data  
using external programs to format it this way (ie. make it csv). This  
is most often the best choice as it is still fairly flexible (you can  
just add column/commas).

All of the above topics are covered by computer science books that can  
be found at the library. I don't have specific titles, but here are  
some search terms:
- Data Structure Java (for arrays, vectors and lists)
- Object-Oriented Programming Java (for classes and objects)
- Database Input Output Java (for data i/o)

>

On Jan 22, 2006, at 12:56 PM, Mike Godwin wrote:

> Hey all,
>
> Figured I'd throw out some of the questions I've been having with my
> work, and see if anyone might have answers.  Mostly techie Java
> programming questions, so let me know if this isn't the forum.  But I
> figured we're all going to start struggling with these questions to  
> some
> degree and maybe there is some collective wisdom out there...
>
> 1) Java programming questions. I have an animation and I'm a little
> unclear about optimum organization of the code -- ie when should one  
> use
> an array or ArrayList or Vector class? What is the syntax for referring
> to 2dimensional Vector type arrays? Also I would like input into  
> general
> object/Class organization - the animated critter is an object, but are
> each of his legs as well?  This will make more sense with a diagram,  
> but
> any input would be helpful.  I'd love a 5 minute chat with a CS  
> inclined
> individual who might be able to look over some sketches and offer  
> coding
> structure input.
>
> 2) preprocessing / data input.  I'll be doing my apple visualizations  
> in
> processsing, and the files I have are all .dbf.  In general I'm trying
> to figure out how much I should preprocess the data to make it lovely
> for my visualization program.  Seems like a trade-off between
> extendability (that is if there is a lot of preprocess it'll be harder
> for me to pull down other datasets and feed them right into the
> visualization program) and ease of coding.  Basically, do I massage my
> 49 .dbf files into a .csv that would be relatively easy to parse in
> processing or do battle with the dbf java libraries and thereby  
> automate
> the massaging in the visualization program. hmm. My new tactic is do
> whatever = visualization fastest then clean up later, but input on this
> topic would be helpful as well.
>
> cheers, mike
> _______________________________________________
> visinfo mailing list
> visinfo at zydeco.mat.ucsb.edu
> http://zydeco.mat.ucsb.edu/mailman/listinfo/visinfo
>
>

George Legrady
University of California, Santa Barbara

MAT: 	http://www.mat.ucsb.edu
ART:	http://arts.ucsb.edu
IGERT: 	http://media.igert.ucsb.edu
STUDIO:	http://www.georgelegrady.com
tel. 		1.805.637.6195
fax. 		1.805.563.5752
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 5208 bytes
Desc: not available
Url : http://lists.create.ucsb.edu/pipermail/visinfo/attachments/20060130/77224907/attachment-0002.bin 


More information about the visinfo mailing list