RE: [Plib-users] SSG for 3ds and ASE
Brought to you by:
sjbaker
|
From: Dave M. <Dav...@dy...> - 2000-08-09 22:34:37
|
Steve Baker wrote:
> >
> > Dan Gelb wrote:
> >
> > 1. Objects with just plain color properties, no textures,
> > show up as white instead of the correct color. Textured
> > objects work properly. I've taken the tux_example and
> > replaced the tux model with models from 3DSMax, but
> > only textured objects show up properly. Is there
> > something I need to enable?
> >
> It sounds like texturing is enabled - but no texture is
> currently bound.
>
The problem turned out to be null color and normal arrays in a ssgVtxArray.
GL_TEXTURE_2D was disabled, as it should be.
The ASE exporter in 3DSMAX can dump vertex colors (if you mark the checkbox
for them) but they were not present in the files you gave me. You might
have to *bake* them in first using the "Assign Vertex Color Utility". It
takes the scene lighting and computes each vertex color. What is you see in
3DSMAX is what you get in SSG. I always bake my colors and use texture
mapping, so I didn't see the problems you were having.
Regardless, ssgLoadASE should handle this better so I addressed this problem
and did a CVS commit. The source change in ssgLoadASE is based on
ssgLoadAC:
if ( data -> st -> isEnabled ( GL_LIGHTING ) )
{
if ( data -> cl == NULL )
{
sgVec4 c ;
sgCopyVec3 ( c, mat -> diff ) ;
c[3] = 1.0f - mat -> transparency ;
data -> cl = new ssgColourArray ( 1 ) ;
data -> cl -> add ( c ) ;
}
if ( data -> vl -> getNum () >= 3 )
{
sgVec3 n ;
sgMakeNormal ( n,
data -> vl -> get(0),
data -> vl -> get(1),
data -> vl -> get(2) ) ;
data -> nl = new ssgNormalArray ( 1 ) ;
data -> nl -> add ( n ) ;
}
}
I already explained how to get proper vertex colors. To get proper vertex
normals, things get tougher. The ASE format has vertex normals but they are
wrong. :( You'll either have to compute them yourself or fix the ASE
exporter and use that. The ASE exporter source comes with 3DSMAX in the
MAXSDK cdrom folder. Blake Senftner has a *fixed* ASE exporter here:
http://www.pond.net/~davem/asciiexp/. I have not had time to look at this.
If the format is still compatible with the *old* ase format and the vertex
normals are correct, I can fix the ASE loader in SSG to read them. Please
let me know if you can help investigate.
Anything that relates to improving support for the ASE format in SSG is very
important to me. Thanks for reporting the ASE bugs.
-- Dave McClurg
mailto:dav...@dy... http://www.dynamix.com
mailto:da...@po... (home) http://www.pond.net/~davem
|