Articles Archive
Articles Search
Director Wiki
 

Using Director at RIT

February 3, 2005
by Andrew M. Phelps

Abstract

The Rochester Institute of Technology, and the Information Technology Department where I teach, has long been a user of Macromedia® products, from Dreamweaver to Director and most things in between. Recently, there has been some debate as to the future of Director’s role, with the increasing use of Flash in the marketplace for web graphics and interactive displays. While we have moved some of our efforts to Flash technologies, RIT and the IT Department remain committed to the use of Director, because currently no other product on the market can meet our specific needs for an easy to script, but performance aware 3D system, capable of delivery on the web and via downloadable executable.

The shift to ECMAScript syntax represents a major advancement to the Director product, and is important to us for a number of reasons. The primary reason for the inclusion of this feature seems to be to provide for a more common language and syntax between Macromedia Flash MX and Macromedia Director. We are capitalizing on the similarities in the new syntax to create a stream-lined educational experience, to bring the products as close together as is currently possible. It also allows for a more complete object oriented structure, and better tools for list management and string operations.

1 THE INFORMATION TECHNOLOGY DEPARTMENT / at / RIT

1.1 MAJORS, DEGREES, AND STUDENTS

The Information Technology Dept. at RIT currently enrolls over a thousand undergraduate students, and approximately four hundred graduate students majoring in Information Technology, Networking & System Administration, Software Development & Management, and New Media. We are also hard at work in developing offerings in Game Programming (a concentration already exists and we are pursuing plans for an MS Degree) and Digital Security. The Department is housed in the B. Thomas Gollisano College of Computing, which incorporates the IT Dept., along with Computer Science and Software Engineering. Courses are generally open to any of the students in any of these programs, as well as to select students in the College of Imaging Arts & Sciences (CIAS), and other students from other areas of campus.

1.2 STUDENTS AND EDUCATIONAL OBJECTIVES

The direct effect of all the different majors and minors available to students is that we have several different types of students in our courses. Some are coming from traditional computing backgrounds, heavily immersed in math, science, and programming, while others approach application building from disciplines like art, graphic design, and printmaking. Through the New Media program, we share students with CIAS, attracting several different types of students, in addition to the highly technical students that are most often associated with a computing college.

Each of our students is required to learn to program, but because they are majoring in several different fields, their reasons for doing so are widely varied. Some of our students are directly concerned with operating systems and low-level driver design, others could care less, and are solely focused on the user experience. Some are designing pieces for back-end server rooms where performance is key, and to others its all about selling the client with look and feel.

2 WHY DIRECTOR?

2.1 VISUAL PROGRAMMING

Given that we have students involved with the department from several different backgrounds, it is a challenge to ensure that all of them have the basic programming skills that they will need to survive in the IT world. Every student majoring in Information Technology is responsible for completing an introductory sequence in the Java® programming language. In addition, however, each must complete an introductory course entitled Programming for Digital Media. This course uses visual tools like Director and Flash to allow students to create a visual application quickly, before they might be able to do so in Java or C/C++. It is a compelling educational experience to be able to create a visual application, with graphics and sound, in the first year of study.

We have found this to be particularly effective, as one might expect, in teaching students coming from visually-oriented backgrounds (art, graphic design, etc.). But it is also the case that this is a course generally enjoyed by all students because of its visual nature: students want to know that they are creating “real applications”, that look and feel like those they use on a daily basis. Creating command-line driven exercises has the ring of being false, and as such it is this authors’ author's experience that students are more engaged and driven to learn in a visual environment. In fact, I am working on software to allow students to do in Java some of the visual-style programming that makes Flash and Director so appealing.

Recently, we have moved much of the coursework in Programming for Digital Media from Director to Flash. This is so that students will have the Flash experience, and because it seems to be the tool of choice for interface design and implementation. It handles buttons, sliders, and widgets with amazing ease, and the lightweight plug-in makes it a snap to use most anywhere. Indeed we talked about moving all of the material to Flash, but in the end, this was not implemented for the following reasons:

2.2 IMAGING LINGO

The first technology that Director contains that is very important to us is Imaging Lingo. This is a collection of commands that deal with image manipulation, allowing the programmer to copy rectangles of one image to another, get or set a pixel of an image to a specific color, extract or set the alpha of an image, or apply ink effects to an image or a part of one. The reason that this is important to us is that the Imaging Lingo operations, and the functionality they allow, are very similar to the functionality employed in texture management in lower level environments.

I teach several courses on Game Programming, including 2D and 3D Graphics using DirectX and OpenGL. Students develop engines in C/C++ and manipulate textures directly on the graphics card. But the operations, from loading images, copying bits, dealing with alpha, etc. have direct parallels in Imaging Lingo. Students that have taken the pre-requisite coursework in digital media have almost no problem grasping what is going on inside a modern graphics engine, because of their familiarity with the concepts.

Director makes a great play-space and learning environment to explore imaging concepts because it shields the programmer from the one thing they are most likely to encounter – access to undefined memory. If any of the coordinates that an image copy run amuck, then you are likely trying to read from or write to memory that you don’t “own”. Dealing with this in C/C++ is rather a pain, and so it is convenient to explore these concepts within the protective shield of the Lingo framework.

2.3 SHOCKWAVE 3D

The feature that is the single most important reason that the IT Department is using Director is by far Shockwave 3D. No other package on the market provides a cheap, easy way to script a 3D Engine with hardware access that can be played back on a machine within a browser and without the latest in graphics hardware.

The ease with which a student can get a 3D engine up and running with Shockwave3D is almost mind-blowing: we left it in Programming for Digital Media as the one Director-based assignment, because the ability to do anything in 3D is so important to the student mindset and really empowers them to think “Hey, I can do this” well before their programming ability would allow them to get involved with 3D in a traditional sense. The 2D and 3D graphics courses, for example, are taught in the 3rd and 4th years of study in the Information Technology program, and is also taught in later years in the Computer Science program.

To give a sense of how easy it is to get something happening in 3D, the code presented in Figure 1 is a simple example of placing a cube at the world origin and then rotating a camera around it on a per-frame basis. With the new ECMAScript Syntax in DMX 2004, this is very similar to Flash programming, and our students can bounce back and forth with relative ease.

//SIMPLE3DWORLD CLASS
/*--------------------------------------------
constructor for Simple 3D World Object
---------------------------------------------*/
   function Simple3DWorld(sName, iSpriteNum) {
      //set basic props
     this.sName = sName;
     this.iSpriteNum = iSpriteNum;
     this.ThreeDSprite = sprite(iSpriteNum);
     this.ThreeDWorld = sprite(iSpriteNum).member;
     this.mSphereSetup(); //create a sphere
     this.mCameraSetup(); //position camera
   }
    /*--------------------------------------------
   Simple3DWorld::SphereSetup
   creates a sphere at 0,0,0 with radius 200
   ---------------------------------------------*/
   Simple3DWorld.prototype.mSphereSetup = function() {
     //create a template (model resource)
     //for how to build a spheres
     this.mrSphere = this.ThreeDWorld.newModelResource(
                     this.sName + "_model_resource",
                     symbol("sphere"));
     //fill out properties of the template
     this.mrSphere.radius = 200;
     this.mrSphere.startAngle = 0.000;
     this.mrSphere.endAngle = 360.000;
     this.mrSphere.resolution = 50;
     //build a sphere in the world
     this.mSphere = this.ThreeDWorld.newModel(
                    this.a_sName + "_model",
                    this.mrSphere);
     //set its position in the world
     this.mSphere.transform.position = vector(0,0,0);
   }
    /*--------------------------------------------
   Simple3DWorld::CameraSetup
   positions the camera at XYZ 0,200,800, pointed
   at the origin
   ---------------------------------------------*/
   Simple3DWorld.prototype.mCameraSetup = function() {
     var vCamPos = vector(0,200,800); //cam position
     var vLookPos = vector(0,0,0); //lookat position
     var vUp = vector(0,1,0); //"up" orientation
     //get a handle to the default camera created by S3D
     this.oCamera = this.ThreeDWorld.getProp("camera", 1);
     //set its world position
     this.oCamera.transform.position = vCamPos;
     //point it at the origin, with no rotation along
     //its local Z axis (vUp matches world-space up)
     this.oCamera.pointAt(vLookPos, vUp);
   }
    /*--------------------------------------------
   Simple3DWorld::Update
   called per frame to animate camera in a
   simple loop
   ---------------------------------------------*/
   Simple3DWorld.prototype.mUpdate = function() {
     //rotate the camera around the Y-axius
     //2 degrees per frame, using world coordinate
     //space.
     this.oCamera.rotate(0,2,0,symbol("world"));
   }
    /*--------------------------------------------
   Simple3DWorld::ResetWorlds
   called on movie destruction, resets the 3D
   castmember to its original state.
   ---------------------------------------------*/
   Simple3DWorld.prototype.mResetWorlds = function() {
     this.ThreeDWorld.resetWorld();
   }
   
//STARTMOVE & STOPMOVIE SCRIPTS
//global start and stop movie functions
//these are provided by director
   function startmovie() {
     //create an object to setup and control
     //the 3D world. Pass it which sprite number
     //the 3D cast member is in.
     _global.o3D WorldObject = new Simple3DWorld("sphereWorld", 1);
   }
   function stopmovie() {
     //clean up after ourselves, reset the world
     //to an empty one, and clear all globals
     _global.o3DWorldObject.mResetWorlds();
     _global.clearGlobals();
   }
//EXITFRAME LOOP
//called once per frame
   function exitFrame() {
     //rotate the camera in the 3D world
     _global.o3DWorldObject.mUpdate();
     //loop back to this frame again
     _movie.go(_movie.frame);
   }

Fig. 1 – Code for box / camera demo

3 PROJECTS RIT IS INVOLVED IN

While the above is a good example of how easy it can be to get involved in Shockwave3D, we are heavily involved in projects of greater complexity. While it is impossible to catalog all of the ways in which we use Director and other Macromedia projects, the following are a brief smattering of things we have done recently with Shockwave3D, and how the use of that technology was incorporated.

3.1 GAMES & 3D ENGINES

Games are an important part of our curriculum, both as educational tools, and as a concentration area. Some of our students have gone on to work in the games industry, at Microsoft, Electronic Arts, and several smaller studios. Exploring game programming and engine building is currently a very hot academic area, and Shockwave3D allows students to start building 3D games in advance of taking the more traditional graphics courses. One of these projects, entitled “Project Broadsword”, has been used in several papers at the Director Online User’s Group as an example project for various techniques that were explored during its construction

Figure 2: “Project Broadsword” – A 2.5D shooter game in Shockwave 3D. The Broadsword engine achieves framerates comparable to those of a traditional shooter engine in C/C++. Copyright 2003-2004 A Phelps, A Cloutier.

In addition, because S3D allows access to hardware, we’ve capitalized on that in two ways. It is possible to write traditional 2D games in S3D by fixing the camera perspective. This way of working allows us to design 2D games to the industry standard 60 FPS, which we have been largely unable to accomplish using the traditional engines in either Director or Flash.

We’ve also been able to manipulate the access that Director provides to graphics hardware to add in support to the Nvidia Cg language. Using a custom Xtra we’ve designed, we can use Director as an environment to explore vertex- and pixel-shader development. While this project is currently just begun, it has the potential to be a very useful prototyping tool.

Figure 3: Nvidia Cg Support in Director. Dave Parks and A Phelps 2004.

That Director allows us the XDK at no extra charge to develop in-house tools for the product is a great fit for us. In the future, hopefully more of the S3D XDK will be made publicly available.

3.2 SHARED EXTENSIBLE LEARNING SPACES

My colleagues Prof. Steve Kurtz and Prof. Nancy Doubleday run an upper-division course every year entitled “Shared Extensible Learning Spaces” which focuses, which is an evolving set of strategies for the representation of complex concepts in interactive media spaces. In current projects, faculty and students are creating 3-D spaces populated by smart actors to explore emergent behavior in self-organizing systems and document the cognitive experience of users in virtual worlds. They are developing tools using the Macromedia Director environment at three levels: At the top level are complete products: interactive simulations for learners and researchers. The bottom level is an extensible set of modules and components for the programming environment in which our tools are built. Our middle level tools allow user/authors to participate in the SHELS project at the level most appropriate to their skills and objectives. These components scaffold the experience of simulation building for content experts and learners whose purposes are best served by working at a higher level. We design our environments to facilitate active learning and encourage inquiry and scholarship at every level.

One of the early prototype worlds for the SHELS system was the ‘Tractor War’ world, that allowed the user to observe an ongoing battle between teams of varying color (“red team”, “blue team” etc) that had different evolutionary algorithms for obtaining and storing food. The teams were represented by tractors (which gathered food) and barns (that stored it) in a 3D world, as shown in Figure 4. That Director allows a multi-user architecture and the ability to provide 3D front-ends to the networked data was a key component in the design of this application.

Figure 4: Tractor and Base from different teams in the “Tractor Wars” environment.

3.3 DATA VISUALIZATION PROTOTYPING

A final way in which we use Shockwave3D is by prototyping data visualization. A team of students can get a prototype off the ground in just a few days, as opposed to building a complex system that may take months or even years to construct. Since experimentation in visualization is generally an unknown – ie you never know if your way of visualizing something will be effective until its attempted – the need for rapid prototyping is paramount. We’ve used Director to simulate file system visualization (Figure 5) as well as cellular automata growth (Figure 6). In the case of the file system example, it showed enough promise that we went on to develop a more robust system in C++/Java that we are currently still testing.

Figure 4(top) and 5(bottom). Exploration of a windows file system and cellular automata.

Conclusion

Director is a powerful tool for use in educational institutions. It allows students to ramp up quickly into creating the type of applications they want to build, and provides building blocks for those that go further on to study lower-level programming languages. The new syntax afforded in DMX2004 allows a closer working relationship with FlashMX users, and this has been advantageous to us in teaching students from a wide variety of backgrounds by providing a common language core. We have been very impressed with what we have been able to accomplish with the existing Shockwave3D package, and hope to continue to see use of this product grow both within the academic community and the industry at large.

Andrew (Andy!) is a professor at the Rochester Institute of Technology (RIT) serving in the Dept. of Information Technology, specializing in Multimedia and Web Programming. While completing his MS in Information Technology, he became increasingly interested in multi-user virtual spaces. He is also developing a game programming curriculum, with an emphasis on Lingo based solutions as well as more traditional approaches. Visit his home at andysgi.rit.edu.

Copyright 1997-2017, Director Online. Article content copyright by respective authors.