Getting Started
Ygdrasil nodes are written in C++, so a C++ book or some web references will be very helpful. Once you've gotten the process working, take a look at the source code for the existing YG nodes, and see what you can figure out about how they work.
First, some background information. YG Nodes, like all C++ programs, exist first as a source code file, written in a language that humans can read. After you've written your program, you compile it into a file that the computer can run. Many languages, like ActionScript, Lingo, JavaScript, and Ygdrasil, are interpreted languages, meaning that the computer translates them on the fly, rather than compiling them first. Usually, the advantage of compiled languages is that they are faster, which is good when doing heavy interactive 3D graphics.
C++ source code has the extension .cxx (or, sometimes, .cpp). For some programs, the source code compiles to a standalone application, like the Firefox web browser. In our case, we're writing a plugin for Ygdrasil, not a standalone program. Think of it like a Photoshop plugin. These plugins have the extension .so, which stands for Shared Object - they're like components that can be used by different programs. The reason for doing this is that if you want to add a new feature to Ygdrasil, you can just write a node as a small component, rather than having to recompile the entire Ygdrasil program itself.
In your yg directory, make a directory called "modules" and one called "dso.linux". Modules is where you'll put the source code for your nodes, and dso.linux is where the compiled nodes are stored. Just for fun, take a look in /usr/local/yg/modules and /usr/local/yg/dso.linux. That's where the standard YG module nodes are stored.
Now, you'll need some files to start working with: a source code template, and a Makefile. Right-click on each of these and save them in your modules directory.
- dummynode.cxx : the C++ source code for a simple template YG node
- dummynode.h : the C+ header file for dummynode. The header file just defines the functions of the node, while the .cxx file has the actual code.
- Makefile : this is the configuration file for the make program, which does the compiling
- Makedefs.linux : more configuration for compiling nodes on Linux
- Makedefs.sgi : configuration for compiling nodes on SGI
(c) Ben Chang