Wolfgang Dobler:
|I have constructed a twisted ribbon where the two sides are nicely
|distinguished by setting front and back colors to yellow and blue,
|respectively. This works fine with software rendering, while hardware
|renders the ribbon all in yellow (maybe Mesa or OpenGL have no notion of a
|two-sided surface??), which doesn't really bother me.
AFAIK OpenGL doesn't support this. Two sided materials with lighting yes,
but not two sided colors without lighting. (it could be faked by drawing
the geometry twice with backface culling, though at a performance penalty)
| What bothers me however is that I would like to export the ribbon to
|VRML, convert the .wrl file with vrml2pov and render it with Povray using
|textures, complex lighting, etc. But both, my VRML viewers and Povray
|just show the ribbon in yellow, so I suppose the VRML file has already
|lost the second color (or the two-sidedness).
|
|My question is thus: Is there a way to export the ribbon two-sided, with
|different colors to VRML?
| If not, I suppose I will have to add a second, slightly shifted ribbon
|of the other color. What is the easiest way of doing so, as I have to
|shift the second ribbon in a varying direction (the normal of the ribbon)?
I'm not sure but I think VRML's in the same boat. You could repeat
geometry with different colors using backface culling (solid TRUE), but
it's a hack. However, it doesn't look like the VRML exporter in DX
supports the notion of either front or back colors. VRML is ASCII though,
so you could generate two VRMLs by successively renaming "front/back
colors" to "colors", and then merge them together, but it'd be a manual
process.
It's unfortunate DX doesn't have a more useful export route for renderable
fields than VRML (which many tools can write but few tools can read) like
3D Studio or OpenFlight. We occasionally wish for that around here too.
However, PolyTrans now allegedly parses VRML very well, so that may be a
good route if the VRML exporter is beefed up a bit (however, I haven't
tried Polytrans' VRML support personally).
An alternative might be to check out Richard Gillilan's RIB export module
for DX:
ftp://ftp.tc.cornell.edu/pub/Data.Explorer/by_discipline/chemistry
You could use BMRT for your ray tracing, or PRMan or another Renderman
renderer if global illumination isn't a requirement.
Randy
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA N127-01; RTP, NC 27711