Debugging projects can be very tedious and trying. This is the case even more so in a 3D environment. One must take into count the mathematical calculations of 3D space as well as those of 2D space. Truevision 3D contains a debugging system which outputs valuable information that helps developers to pin point and fix errors and adjust values until they are just proper.
In the steps below you will learn how to enable the debugging system and how to write data to the debug file.
Step One - Enable the Debug System
The first step involves enabling the debugging system and setting a file to output the debugging information to. To enable the debugging module, call the 'SetDebugMode()' function in the TVEngine object, using the proper parameters. You will also also need to set a file to output the debugging information, to do this, use the 'SetDebugFile()' and supply the path as the parameter. The code given below is a working example of how to enable the debugger and set an output path.
// Enable the Debug System
Engine.SetDebugMode(true, false);
// Set the Debug File
Engine.SetDebugFile(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\Editor.log");
The second parameter in the 'SetDebugMode()' function, if set to true, will also write the debugging information to the console. This will allow you to view the output without accessing the debug file.
Step Two - Writing to the Log
Not only does the Truevision 3D debugging system output its own information, but it allows you to output string and variables to the debug file. Here is an example usage of the engine's 'AddToLog()' function,
Engine.AddToLog("Camera Position: " + Scene.GetCamera().GetPosition().x.ToString() + ", " + Scene.GetCamera().GetPosition().y.ToString() + ", " + Scene.GetCamera().GetPosition().z.ToString());
The example source code given above will write the camera's position to the debug file. You can export any variable that can be converted into a string to the debug file.
Published by James Cloud
I like to program and do basically anything that has to do with technology and computers. View profile
- Tips and Tricks for Your Mac2 programs to speed up your mac.
- The Principles of Batch Process Program DevelopmentLearn how to develop, test, debug, and implement batch process programs on your home computer with The Principles of Batch Process Program Development series.
- Useful Software Tools You Can DownloadComputers have become our daily productive utility. This is a list of free software tools one can download onto their desktop to be more productive.
- Commands in DOSSome commands in DOS
- Programming: Creating ExecutablesMaking executables in the QuickBASIC and Visual Basic programming languages, with details on versions which can and cannot create them.
- The Basic Principles of Batch Process Program Development: Testing, Analyzing, and...
- All the Shortcuts to Get Around in Windows Quickly and Easily
- CSharp .Net Tutorial: Loading Textures in Truevision 3D
- OnyX - a System Maintenance Utility for Mac
- The Evolution of Computer Programming Languages
- How to Program with Assertions in Java Technology
- Thesis: "Computer Systems Emulator"



