David Brin Fan Fiction
Art and 3D Graphics
Chmeee's 3D Objects
BMRT & VC++
Million Dollar Band
I've wasted a lot of time I could have used making BMRT images,
just trying to figure out how to make Visual C++ 4.0 work with the
libraries. When I had trouble with it, I asked
Michael B. Johnson, who did
the Windows port, what the problem might be. He told me that he
built the libraries for VC++5.0, and 4.0 may not even be able to
use them. I put the problem on the back shelf after that, until I
thought to ask the DJGPP newsgroup.
Gerhard Gruber told me that you can use the libraries in 4.0.
After that, I quickly figured out how to use the BMRT libraries.
Enough talk -- How Do You Do It?
Bear in mind, that I'm not going to teach you how to WRITE a
program. A good place for learning about that is The
Renderman Companion, by Steve Upstill. These instructions
will just let you use the annoyingly complicated Visual C++.
- Put the BMRT include file and libraries in the right places: copy
ri.h into the C:\MSDevStd\include directory, and copy
libribout.lib and libslcargs.lib to C:\MSDevStd\lib
- Start up VC++ 4.0
- Go to File | New... and choose a New Project Workspace. Make
it a console application (that is, a DOS command-prompt-type
program), so you don't have to worry about the complicated
Windows MFC stuff. Then, type a name for your project, like
"RiTest" (don't include the quotes!), and hit enter. You now
have a new VC++ project.
- Go to File | New... again, and create a new text file. Save
it as RiTest.c, or any other name, but I prefer to give the
C file the same name as the project. Write a C program to
generate RIB files (or if you already have one written, move
it to the c:\RiTest directory, and rename it RiTest.c.)
- You need to add the C program to the project. Go to
Insert | Files into Project, and choose the C program you
- Now, go to Build | Settings. This is what the settings window
Look for the tab marked "Link". If you don't see it, use the
little buttons with arrows on them to move the tabs over, until
you find the "Link" tab. Click the "Link" tab. Now that you're
in the Link window, add libribout.lib and libslcargs.lib to the
Object/Library Modules text box, as shown:
Now this part is the big secret, the part I just figured out --
you need to find some way of keeping the compiler from linking
the libc library. For some reason, the BMRT libraries seem to
clash with libc. To keep the pesky libc out of your executables,
click the "C/C++" tab, and enter ', "/Zl libc.lib"'. Make sure
that's Zl, as in lamb.
- Now, you're ready to build your program! Just click Build |
Build RiTest.cpp. The executable will appear in the