My notes on clump hierarchies

Report any bugs found in the testing versions
Post Reply
Byte
New member
Posts: 2
Joined: Mon Aug 23, 2010 7:05 am

My notes on clump hierarchies

Post by Byte »

Okay, so to help you get avatars working, here's what I've got on clump hierarchies:

The last column of the matrix should always be 0, 0, 0, 1 like:

Code: Select all

1 0 0 0
0 2 0 0
0 0 3 0
0 0 0 1
Essentially ignore every 4th element of the "transform" command in the RWX file.

ClumpBegin is an implicit TransformBegin and pushes the CTM onto the transform stack and replaces the CTM with a fresh identity matrix. ClumpEnd pops it off and replaces it. When you go to draw a clump you take the CTM before you replaced it with identity (at the top of the stack) and do:

Code: Select all

glPushMatrix();
glMultMatrix(ctm);
drawClump(child);
glPopMatrix();
Edwin
Site Admin
Posts: 163
Joined: Mon Apr 09, 2007 10:04 am
Location: Almere, The Netherlands
Contact:

Re: My notes on clump hierarchies

Post by Edwin »

It seems to work fine when I don't set the matrix to identity after clumpbegin but just copy it, clumpend will pop it off anyway. In VP the hierarchy is entirely flattened so it does not really matter as long as it comes out right in the end.

Something that I'm still wondering about is the joint transform matrix, how is it used exactly? VP right now does not make a difference between the joint transform commands and the other transform commands. The model mount1.rwx in the object path of VP-Build seems to be using identityjoint to reset a scale applied with the normal transform command. If I just ignore the identityjoint command the avatars will render correctly, mount1.rwx however will be rendered with a factor 10 scale.

Mount1.rwx looks like this:

Code: Select all

modelbegin
transformbegin
transform 10.000000 0.000000 0.000000 0.000000 0.000000 10.000000 0.000000 0.000000 0.000000 0.000000 10.000000 0.000000 0.000000 0.000000 0.000000 1.000000

jointtransformbegin
identityjoint
clumpbegin
color 0.000000 0.000000 0.000000
surface 0.000000 0.000000 0.000000
opacity 1.000000
lightsampling facet
geometrysampling solid
texturemodes lit
materialmodes null
texture null

addhint editable

<lots of vertices here>

color 0.843750 0.578125 0.562500
surface 0.250000 0.700000 0.180000
lightsampling vertex
addtexturemode foreshorten
addmaterialmode double
texture jade

<los of triangles here, no quads or other polygons>

clumpend
jointtransformend
transformend
modelend
identityjoint used like identity:
Image

identityjoint ignored:
Image
The blue wall is what used to be the blue mountains in the background, I have not found any other models affected by this.
Byte
New member
Posts: 2
Joined: Mon Aug 23, 2010 7:05 am

Re: My notes on clump hierarchies

Post by Byte »

I just ignore it. It seems to be the standard for handling RWX, to ignore the jointtansform.
Post Reply