Thursday, February 28, 2008

Original Triangle

I've been working with the original Triangle program from K. D. I compiled it and saved it as a .jar file. I also played with the coordinates for the endpoints and successfully flipped it over.


The new .jar file. The coordinates are specified in the code as follows:

// Remember to
// draw the points in counter-clockwise order. That is the default
// way of determining which is the front of a polygon.
// o (1)
// / \
// / \
// (2) o-----o (0)
Shape3D shape = new Shape3D();
TriangleArray tri = new TriangleArray(3, TriangleArray.COORDINATES);
tri.setCoordinate(0, new Point3f(0.0f, 0.0f, 0.0f));
tri.setCoordinate(1, new Point3f(0.5f, 0.5f, 0.0f));
tri.setCoordinate(2, new Point3f(-0.5f, 0.5f, 0.0f));

The coordinate array takes inputs for x,y,z for each of 0,1,2. To invert, I moved 0 to the origin, 1 to .5,.5 and 2 to -.5,.5.

Wednesday, February 27, 2008

Orbit Program

I successfully compiled the Orbit program from Kevin Duling's website. I took a screenshot from my system as it was running in an application window.

I was also able to export the code to a .jar file. This acts as a standalone executable file and will produce the rotating triangle in an applet window. The file hosted here; just extract the .zip file. Use left, right, and center mouse buttons to manipulate the triangle.

Monday, February 25, 2008

Last Week's Update

I spent last week reading my books on JavaScript programming to be able to better understand source code I might find online. I typed and successfully ran several sample programs from the text. Now I'm picking apart the code on Kevin Duling's website for Java3D and trying to compile it within Eclipse.

Friday, February 22, 2008

wish lists 2/22/2008

Notes from meeting 2/22/2008

High Priority Wish list:
Direct assignments (for variables?)

Re-initialize variables (right now it carries values over from last run into the next run )

Ability to delete each panel (right now no ability to clear certain panels)

Delete variable (if you try to delete a variable while still using it in the code it should give you an error message “you can’t delete this variable until you delete the panel that uses it”

=============
Medium priority wish list
Save code

Include the name of the music file in the saved code

==================
Low priority wish list:
Preview – need to ask Tiffany’s group what to display when you “step though” the program. Might be useful to look at Scratch and see how it resolves that issue.

Show frame number under animation (should be option that user can switch on or off)

Show dancer names under animation (should be option that user can switch on or off)

Additional integer math functions (rand, mod, ceiling, floor, etc.)

Float math functions (float var, sine, cos, exponent, log, etc.)

===================
Future priority wish list
Interaction features (you can code for a button, slider, fill-in, etc. to appear on animation screen, so that rather than just watch a movie the user can interact with the animation).

3D “props” – dance around a mayan pyramid or bonfire, juggle swords, etc.

Build-your-own 3D props—design your own 3D props. We probably want to have a specialized tool—perhaps appearing as an “editing” tab—for creating these. Could also import from other CSDTs and pCSDTs.

Non-humanoid bodies

Build-your-own body

Friday, February 15, 2008

Tutorials

I spent today reviewing tutorials in the Workbench User Guide and performing tasks (those listed in the guides) to increase my proficiency with the functions of Eclipse, it's menus, and Java programming. Once I finish the tutorials, I will move onto more general Java tutorials and compiling source into applications.

Thursday, February 14, 2008

Hello World SWT

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


public class HelloWorldSWT {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Hello world!");
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}

}

I followed another tutorial to create a small application. I downloaded the SWT (Standard Widget Toolkit) from Eclipse and once installed, it allowed me to generate an empty window with "Hello World" as the title.

Tuesday, February 12, 2008

Hello World

public class HelloWorld {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}

}

I was able to follow the Eclipse tutorial and execute this simple "Hello World" program.