Tuesday, August 2, 2011

Work completed 07/28 - 08/02

Incorporated wigwam grid display code into drawing window of WW based on Core application framework.  Grid now displays correctly in drawing pane as follows:


Currently working on adding logic for adding arc objects.  hope to be done with this over next couple days.

Thursday, July 28, 2011

Work completed 07/21 - 07/27

Set up a new Wigwam project based on the pCSDT application framework.  This involves the following:

1.  Set up new project called WW with proper references to the Core library that contains the code for pCSDT.
2.  Define a new class called WigwamEngine that extends PEngineOgl (from core) which detects the new classes representing objects to be drawn, Arc and Torus.
3.  Define a new class called WigwamGui that extends PGuiOgl (from core) which creates the gui environment and holds a reference to the WigwamEngine object.

Currently working on overriding the Draw() method of PEngineOgl that will contain logic for drawing the grid Wigwam application.  This was discussed in yesterday's meeting.

Wednesday, July 20, 2011

Work completed 07/14 - 07/20

Incorporated functionality for producing semi-circular arcs (an enhancement to the existing functionality that produces parabolic arcs in the wigwam applet).  The idea is to utilize this functionality for producing bucky balls. However, coincident with this, embarking on an effort to port the wigwam applet to the pCSDT application framework and to create bucky ball functionality within that environment, as well.

Met with Jed Williams on campus on Monday, 07/18.  Discussed his application, the break dancer applet and its design, given it is built within the pCSDT application framework.  The design is based around 3 major ideas:  first, there is a gui class that extends a framework gui class that establishes the container frame and initializes gui settings; second there is an engine that provides the functionality for objects to be managed and programmed within the pCSDT framework, and third, there are the application-specific objects themselves to be managed within the environment (e.g., the human class and the torus class are both objects of this type within the break dancer).

Next steps include the following:

1.  Port the wigwam applet into the pCSDT application framework.  This involves recreating the grid display, arc production, and arc removal within the context of the pCSDT platform.

2.  Build the functionality for creating tori in the pCSDT application framework in order to support building bucky balls.  Some questions around this issue exist:  Should this functionality be built using the same grid display backdrop that exists for the wigwams?  Or should it be totally separate?  This begs the question of what the students are supposed to be doing with the bucky balls - does the software provide a model for some real-life production of a bucky ball much like the wigwam applet provides coordinates for creating model wigwams?  What aspects of the bucky ball functionality should be programmable?

3.  Make the wigwam functionality programmable.  Questions here include what aspects should be programmable?  One idea is to provide the user the ability to set a number of arcs and an angle between them and then the software automatically creates the defined number of arcs spaced according to the input angle.

Monday, July 18, 2011

Update 07/18/2011

Incorporated functionality to produce circular arcs in the wigwam applet (as opposed to parabolic arcs).  This update leverages current code for parabolic arcs, including transformations for 3d support, but replaces points approximating a parabolic arc with equations for points for a circular arc.  Also, incorporated detailed documentation explaining both the logic for creating points for parabolic arc and for circular arcs.


Next, need to incorporate buttons in gui for segregating creation of circular arcs (eventually to support bucky balls) from the original functionality for creating parabolic arcs (supporting wigwams).

Wednesday, July 13, 2011

Work completed 07/07 - 07/13

Working on leveraging existing code to create new circles within context of a separate project.  Having issues making the graphic (circle) appear on the screen.  This must be a setting within the JOGL environment that I'm missing.  Have been working on this, again, mostly trying to use existing code from Wigwam applet class (i.e., searching for any switches there that could do the trick).  Hope to have this resolved in next few days.

Wednesday, June 29, 2011

Work completed 06/23 - 06/29

Working on creating bucky ball functionality within  the wigwam applet.  This functionality is based on functionality for creating circles on the 3d graph display.  This required the following steps completed over the course of the week:

1.  review Bresenham's algorithm for selecting pixels to approximate circular arcs.  Using the following text as reference:  Computer Graphics for Java Programmers
2.  review concepts for creating 3d perspective (as opposed to 2d graphics).  Using same text as above as reference.
3.  review concepts for creating 3d perspective using jogl library.  Using the following text as reference:  Foundations of 3D Graphics Programming Using JOGL and Java 3D
4.  review wigwam code for creating arcs (specifically the drawArc function of the WigWam class).  This is where the meat of the arc point calculations are performed.

Looking to leverage this code to create circular arcs, then create circular arcs of different angles of rotation about the z axis.

Wednesday, June 22, 2011

Work completed 06/16 - 06/22

Began work on enhancement to Wigwam applet for making horizontal arcs, per the direction from the email below:


---------------------------- Original Message ----------------------------
Subject: RE: weekly update
From:    "Eglash, Ron" <eglash@rpi.edu>
Date:    Thu, June 16, 2011 10:24 pm
To:      johnsj3@cs.rpi.edu
--------------------------------------------------------------------------

Lets take this one step at a time. First step: allow "horizontal" arcs
so the kids can make the part of the wigwam that wraps around the
middle. Then we will worry about buckyballs.

Currently the applet only allows arcs that are "vertical". The user can
only rotate the arc around the Y axis. (Of course we don't mean just the
single Y axis at x=0, z=0. Rather we mean any line running parallel to
the Y axis.)

We need two more degrees of freedom:

1)    Such that the user can rotate the arc around the X axis (Of course
we don't mean just the single X axis at y=0, z=0. Rather we mean any
line running parallel to the X axis. And since they can rotate around Y,
that means it could even be parallel to the Z axis.).

2)    Such that the user can move the arc up higher or lower. We will
need to make sure the labels distinguish this from the parameter that
determine how tall the arc will be,

*****end email************************************
The approach is to leverage code for current functionality for making horizontal arcs.  Attempting to modify existing code to make it sufficiently generic to support both elements of functionality - making vertical arcs and horizontal arcs.  Once this is complete, will address the issue of being able to rotate the arc around the x-axis, hopefully, using code similar to that for rotating around the y-axis.  Finally, linear translation of the axis of axis will be modified/leveraged in the existing code base for supporting vertical translation of the axis for horizontal arcs.  

Wednesday, June 15, 2011

Work completed 06/09 - 06/15

1.  Beginning work on Buckyballs creation.  Need to discuss how this should be used as an instructional tool for the students.  Do we want to use it in a way similar to the way we use the Wigwam applet - where students build a design using the applet and then use the coordinates it creates to build an actual model using styrofoam and bendy wire?  I'm not sure how this would work when constructing a buckyball.  Would we be ok to simply extend this approach so that the student's model consists of bendy wire bi-sected by a styrofoam plane?  Is there a better approach?  If so, what ramifications does this have for the applet creating buckyballs?  If we come up with a separate approach, our decision on approach will imply taking one of the following approaches - 1. incorporating the code into the existing wigwam applet code, 2.  a different applet (but based on the code for wigwam) or 3.  a different applet, developed completely independently of wigwam logic.  Thoughts on this?

2.  Also, started looking into execution issues on netbooks.  Currently I possess two netbooks from the last workshop - one on which the Wigwam applet works correctly and the other on which it does not.  The hope is to isolate the difference between them that's causing the problem.  Hopefully, will determine the cause of this in the next couple days.

3.  Determined source of issues related to installation of Wigwam project on local workstation that prevented execution of code within NetBeans on local workstation.  Summarized issues on post for 06/13.  Documented detailed steps for future developers who may work on this project to lower future startup costs.  Contents of README.txt (located in WigwamV2 folder of project is as follows):

****************************README.txt********************************************

-------------------------
Wigwam Project Configuration
-------------------------

Overview

The Wigwam project source code makes heavy use of the Java OpenGL (JOGL) libraries for graphics support.  These libraries will need to be installed properly on any workstation where development for the Wigwam project is to occur.  Configuration instructions are below.  The official site for downloading the JOGL libraries can be found by going to http://schabby.de/jogl-download/.  However, all of the JOGL binaries for supporting the Wigwam project can be found on the svn server in a zip file called libs.zip on the csdt svn server.  This is the recommended location for downloading since this guarantees proper versioning compatibility with the source code of the Wigwam project.

Configuration instructions

I.  Install JOGL support libraries

1.  Download the libs.zip from the csdt svn server.  It's in the parent directory, a sibling of the other csdt projects on the csdt svn server.
2.  Unzip the file and install the files in the jogl directory to a directory on the local workstation.  For example, install them in c:\java\jogl\lib.  The files selected should include the following:

jogl.jar
gluegen-rt.jar
jogl.dll
jogl_cg.dll
jogl_awt.dll
gluegen-rt.dll
libjogl.jnilib
libgluegen-rt.jnilib
libjogl_cg.jnilib
libjogl_awt.jnilib

The jar files are contain compiled java source code modules, .class files.  The .dll files are libraries for calling graphics routines native to the operating system platform.  The .jnilib files contain functions that resolve calls in the .class files and the routines in the .dll files.

3.  Add the directory from step 2 to the PATH environment variable (on Windows), or the corresponding environment variable if on a UNIX system.  This environment variable will allow the operating system to find the .dlls listed above whose routines are called by the JVM at runtime.

II.  Install the Wigwam project.

1.  Download the Wigwam project from the csdt svn server.
2.  Open the project in NetBeans by navigating to the ..\VirtualWigwam\WigwamV2 directory in the Open Project dialog.
3.  Once the project is open, reset the JOGL library to reference to the local installation of the jogl.jar file, (installed in part I above).  This file should have been in the the libs.zip.
4.  Reset the GLUEGEN-RT libary to reference the gluegen-rt.jar installed locally from libs.zip.
6.  Right click on the project in the project explorer window and select properties.  In the project properties window, under the WebStart node, set the AppletDescriptor/Applet Class to wigwam.WigwamApplet, (NOT wigwam.Wigwam).
7.  In the project properties window, click on the Applet parameters button.  Set the width and height dimensions to 900.

"Gotchas" that can cost a lot of time configuring this project

1.  There are other versions of jogl on the internet.  These don't necessarily work with the current version of the Wigwam applet.  For example, there is a package at http://csis.pace.edu/~marchese/CG/JOGL/Jogl1l.htm.    Don't be lured into downloading the jogl deployment package at this site - it won't help because of incompatibility with the Wigwam project and will only lead to trouble.  Such packages may have a different interface but some commonality, (just to further confuse things) from the version required by the Wigwam applet.

2.  In order to prevent confusion, make sure only one version of JOGL is installed on the local workstation.  Multiple installations can cause havoc with the PATH environment variable since Windows will search through the path only until it finds a dll with a matching name.  If there are multiple such files with the same name, the directory to the wrong one may be listed first in the PATH variable, and trouble will ensue.

3.  Make sure the Applet class is wigwam.WigwamApplet, not wigwam.Wigwam.  Both of these classes extend JApplet, and thus, constitute applets.  However, in order for this project to render correctly in the browser, the applet class needs to be WigwamApplet.

III.  Test the applet.

1.  Compile the project. (Shift-F11 in NetBeans.)
2.  In the Files explorer window, navigate to dist/launch.html, right click, and select launch.html from the pop-up menu.  This will fire up the default browser and the applet should be rendered from the local workstation.
3.  Also, as an alternative, the applet can be kicked off in the applet viewer by right clicking on the WigwamApplet.java class in the project explorer window and selecting Run File.

**********************End README.txt**********************************************

Monday, June 13, 2011

Update 06/13/2011

The wigwam applet is now compiling AND EXECUTING properly on my local workstation.  See picture below:


The key configuration elements in order to arrive at successful execution are as follows:

1.  Add a library to the project called JOGL referencing the jogl.jar file from libs.zip.
2.  Add a library to the project called GLUEGEN-RT referencing the gluegen-rt.jar from libs.zip.
3.  Ignore/delete the libary, JOgl in the project.
4.  Load the following files into a local folder on the workstation (all from libs.zip):  jogl.dll, jogl_cg.dll, jogl_awt.dll, gluegen-rt.dll, libjogl.jnilib, libgluegen-rt.jnilib, libjogl_cg.jnilib, libjogl_awt.jnilib.
5.  Add the directory in which the files of step 4 were placed to the Windows PATH environment variable.
6.  In the project properties window, under the WebStart node, set the AppletDescriptor/Applet Class to wigwam.WigwamApplet, (NOT wigwam.Wigwam).

"Gotchas" that cost a lot of time in figuring this out:

1.  There are other versions of jogl on the internet.  These don't necessarily work with the current version of the Wigwam applet.  One version that I made the mistake of trying to use during experimentation (based on a search for jogl_cg.dll) is at http://csis.pace.edu/~marchese/CG/JOGL/Jogl1l.htm.    Don't be lured into downloading the jogl deployment package at this site - it won't help you and will only serve to confuse the issue!!!!  This version has a DIFFERENT INTERFACE (but some commonality, just to further confuse things) from the version required by the Wigwam applet.  Also, it does not have the required gluegen_rt.jar, gluegen_rt.dll, and the jni libraries required for the graph of the Wigwam applet.

2.  Even when it is known that the two libraries, (the one in libs.zip and the one from the site given above), are different, one must be careful about the way in which the directories to which the libraries are installed are ordered in the PATH environment variable.  That is, even though the path to the correct set of libraries (from libs.zip) was included in the PATH variable, that directory was listed AFTER the directory for the one for the package downloaded from the marchese site, which meant that the OS would resolve function calls to the wrong libraries because their names/some elements of interface matched in the wrong files.  Once the directory to the marchese package was deleted, the function calls were resolved correctly by the OS.

3.  As alluded to in item 6 of the configuration element list given above, make sure the Applet class is wigwam.WigwamApplet, not wigwam.Wigwam.  This setting was created when I first created the project after downloading the code from svn for the first time, before I became acquainted with how the code was organized.  Even though both classes extend JApplet, only WigwamApplet actually has event code for establishing the complete interface (init(), start(), etc.)  This setting had to be rediscovered/changed to WigwamApplet.

4.  It seems that the code will compile without gluegen-rt.jar.  However, strangely, in order for the code to *execute* properly, gluegen-rt.jar must be referenced in the project.

WHEW!!!!!  that was painful, but it's behind us........

Saturday, June 11, 2011

Update 06/11/2011

In an effort to make the current state of my development environment configuration clear, I will describe the steps I've taken (separate from other diagnostic experiments I have conducted) to set up the development environment for the Wigwam project.  they are listed below.  Keep in mind, these steps are based on the documentation provided in the Userguide.html provided as part of the jogl library contained in the libs.zip file on the svn server (a screen shot of the actual jogl installation instructions is given below):


Based on these instructions I took the following steps:

1.  Add a library to the NetBeans Wigwam project call JOGL that references the jogl.jar file.
2.  Add a library to the NetBeans Wigwam proejct called GLUEGEN-RT that references the gluegen-rt.jar file.
3.  Add a directory to the PATH environment variable (Windows Vista is the OS) that contains the following files:


gluegen-rt.dll
jogl.dll
jogl_awt.dll
jogl_cg.dll
libgluegen-rt.jnilib
libjogl.jnilib
libjogl_awt.jnilib
libjogl_cg.jnilib

These steps produce the environment that allow compilation but not proper execution - the view of the launch.html produces the x box (no applet) shown in the prior post on 06/09.  What step(s) am I missing?  Any comments are much appreciated.  Thank you!!!!!

Looking at possible addition of entries in the NetBeans environment for PATH (but this shouldn't be needed given we're dealing with an applet running in a browser, not actual NetBeans runtime).

Thursday, June 9, 2011

Update 06/09/2011

The nature of the problem rendering the applet is given below.  As mentioned in my prior post, the compilation process works fine.  (By the way, I notice that there are multiple versions of jogl.dll out there - two of which I have installed on my machine (not realized until started fiddling with them) - wigwam requires the version where GLEventListener is part of the com.javax.media package while there's another where the GLEventListener is part of the net.java.games.jogl package.  Given the fundamental nature by which these versions differ (same class in completely different packages) not surprisingly, the wigwam project won't compile with the second one, only the first, and other projects which I've been experimenting with to get this to work require the other one.)

Anyway, after compilation of the wigwam project, in NetBeans, I go to render it in the browser by navigating to the Files exporer window for the project, selecting the launch.html (created during compilation),  right-clicking on the file, and selecting "View" from the pop-up menu.  This process yields the following:


This problem is likely due to a configuration error associated with jogl.  My workstation is configured as follows:

1.  The wigwam project includes a reference to jogl.jar.
2.  The java sdk bin directory, jdk1.6.0_21/bin, has the following dlls in it:  jogl.dll, jogl_cg.dll.

I have tried creating various other simple (non-applet) projects that verify the usefulness of jogl.jar, jogl.dll, jogl_cg.dll - that is by adding them and removing them and seeing how that affects the compilation and execution of the non-applet test project.  As expected, jogl.jar is required for proper compilation of the test project, jogl.dll, jogl_cg.dll is required for proper execution of the non-applet project.  It was never required to actually have the jogl_rt.dll installed.  However, this may be because the simple code did not require it.  However,  I followed instructions downloaded  from http://csis.pace.edu/~marchese/CG/JOGL/Jogl1l.htm, which did not indicate this was necessary.  However, is it possible this site is outdated?

In order to make sure that there is nothing wrong with the NetBeans installation and its interaction with the Google Chrome browser, I created a simple HelloWorld applet that renders correctly as follows:


So, this verifies that the basic installation of NetBeans, Chrome, the java virtual machine in the browser are all running properly.  This leaves some element of the installation of JOGL libraries.

Based on this, other things I've thought of trying include the following:

1.  Try other version of jogl.dll (that goes with other version of the jogl.jar).
2.  Add gluegen-rt.jar to the mix.  Is this jar required after all - certainly the wigwam code compiles without it.
3.  Add gluegen-rt.dll to the jdk1.6.0_u21/bin folder.

Again, emails with the prior developer Clayton did not indicate a need for gluegen-rt, nor did documentation found on the internet, but since nothing is working, I'm open to any ideas.

Any other suggestions are welcome.

Wednesday, June 8, 2011

Work completed 05/31 - 06/08

Currently working on a problem getting the wigwam applet to run on my local workstation.  The project compiles fine, but does not render from the locally built project in the browser.  Still trying to figure out why.

Reviewed information provided in prior developer's email regarding library references in the NetBeans project.  His libraries do not align with those in the publicly available folder on the svn site for CSDT.  That is, Clayton has  libraries including jogl.dll, jogl-cg.dll, and jogl-awt.dll, whereas the ones provided in the zip on the server are jogl.dll and gluegen-rt.dll.  Have researched the jogl-cg.dll and jogl-awt.dll on the internet.  Turned up a site that discusses installation of JOGL on a workstation that is focused on jogl-cg.dll, jogl.dll, and yet another file, jogl.jar.  The documentation is inconsistent with that provided in the zip on the svn server which focuses on the other three files listed above.  Based on this documentation, I have created a few introductory, elementary projects using jogl.jar, jogl.dll, and jogl-cg.dll on the local workstation.  However, I have not tried yet to see if this installation will work for the wigwam project.

Next step is to create an applet project (as opposed to a regular Java application) in NetBeans using JOGL and see if this renders properly in the browser.  If that works, then will try to render the wigwam project using this installation.  Otherwise, will be researching further...

Tuesday, May 31, 2011

Work completed 05/23 - 05/31

1.  Attended workshop at BGCA, Albany on Friday, 05/27.  Noticed the following phenomenon among various notebooks on which the applet was installed:  On some of the notebooks, the applet ran successfully within the context of the browser, Internet Explorer.  However, in the event it did not execute successfully, then the user clicked on the button at the bottom of the page (in the browser) to trigger a jnlp download.  But this generally resulted in an install that did not have the "remove arc" functionality at the bottom of the page.  Furthermore, in the browser, the applet did not include that functionality either.  Need to determine why the "remove arc" functionality did not load properly.  Initial theory is that the jnlp is loading a different (older) version of the applet that does not have this functionality (?) from the server.

2.  Worked out issue with password for accessing source code in svn.  Simply use network credentials for cs rpi network.

3.  Downloaded source code, loaded it in NetBeans and after was able to get the project to build locally.  However, the following issue arose during the build:

Had to delete what appears to be an extraneous library dependency - JOgl (there's already a library dependency, JOGL for the project.) in the project.  I copied the project.properties file from svn, deleted the line for this dependency, and only then was I able to get the project to compile.  Initially, I mapped this library dependency to the same jogl.jar as for the JOGL library, but NetBeans didn't like that - it immediately picked up on the duplicate reference, and generated an error.  So, eliminating that library completely is the only thing that seems to work.

My guess is this libary, JOgl is a typo.  However, the previous developer would have had experienced an error in the project if both libs were pointing to the same jar file, like I experienced.  This makes me think that this should be kept in mind as we move forward with development - in case there's another library (or different version) that the prior developer was trying to reference.  If that becomes the case, we might have to contact the prior developer, if that's at all possible.  For now, it looks like the project works...

Sunday, May 22, 2011

Work completed 05/16 - 05/22

  1. Attended kick off meeting on Tuesday, 05/17.  Received overview of work to be completed, which included work to be performed on the Wigwam applet, an applet that helps teach kids a conceptual, geometrical understanding of parabolas.  Three areas of work were described - a.  address issue of applet reliability (applet seems to not work properly at various times for students/trainers. b.  make the applet programmable (so that students can drag/drop controls on coordinate plane) c.  make the applet support creation of buckyballs.  This may involve some work with the setting of the applet - moving the xz plane down, or showing negative range of y axis so that full shape of object can be viewed, not just top half.
  2. Attended training session at Boys and Girls Club of America, Albany NY, on Thursday, 05/19.  Trained Brandon, a counselor, on basic functionality of applet and on how to make real-life model from the specs provided by the applet (curve length and end-points).  Biggest stumbling block seemed to be conveying a comfort level with plotting points on the graph paper.
Outstanding issue is getting the security credential (password) for accessing the source code.