|
From: James W. <ja...@fr...> - 2007-10-05 18:01:14
|
Sauro Agostini wrote:
>>
>> Anyway, you need to improve your model. The farmhouse model has
>> multiple references to various groups. Of course in some cases multiple
>> references can make sense, for instance if the references are subject to
>> different transformations, but in this case the multiple references are
>> just siblings in a group. That is, you're rendering things multiple
>> times for no apparent reason. When I removed the multiple references,
>> the model rendered almost 10 times faster with no apparent change in
>> appearance.
>
>
> Can you send me the modified model? It could be very useful for me, I
> tried to remove some references from the 3DMF file, but the
> appearance was different.
>
> Thank you in advance.
>
> Sauro Agostini
(model attached in private mail, not in the list)
Here is the code I used to remove the extra references.
TQ3GroupPosition pos, nextPos;
TQ3Object prevMember = NULL;
TQ3Object curMember;
Q3Group_GetFirstPosition( theGroup, &pos );
while (pos != NULL)
{
nextPos = pos;
Q3Group_GetNextPosition( theGroup, &nextPos );
Q3Group_GetPositionObject( theGroup, pos, &curMember );
Q3Object_Dispose( curMember ); // the group still holds a ref
if (curMember == prevMember)
{
curMember = Q3Group_RemovePosition( theGroup, pos );
Q3Object_Dispose( curMember );
}
else
{
prevMember = curMember;
}
pos = nextPos;
}
Even after this change, I think there is still much room for improvement
in your farmhouse. I am thinking of writing up some algorithms to
modify Quesa groups in various ways, such as merging TriMeshes.
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.com/>
|