[Radiance-general] Re: Trees in the holodeck

Randolph Fritz [email protected]
Sun, 25 May 2003 18:25:19 -0700


I tried it on my Mac with a Radeon 9000 card, and the forest has gotten 
considerably smaller--I'm down to two "trees", both much shorter.  Does 
anyone have non-ATI OpenGL hardware for a check?  Also, looking at the 
code, I wonder--wouldn't that comparison with FTINY be unreliable where 
the arguments of dist2 are very large?  Would that occur under any 
circumstances, perhaps with angles near the quarters?

Randolph

On Sunday, May 25, 2003, at 09:12  AM, Greg Ward wrote:

>> From: Thomas Bleicher <[email protected]>
>>
>> Sorry if this is old news (I have only the 3r1p20 source installed at
>> the moment). I had a quick look at src/common/rglsurf.c and I think 
>> there
>> are some missing "glPopMatrix()" calls:
>>
>> In o_cone (and o_ring) is this sequence (line 266 in my file):
>>
>>    glPushMatrix();
>>                                    /* do base translation */
>>    glTranslated((GLdouble)o->oargs.farg[0], 
>> (GLdouble)o->oargs.farg[1],
>>                     (GLdouble)o->oargs.farg[2]);
>>                                    /* compute height & rotation angle 
>> */
>>    h = sqrt(dist2(o->oargs.farg,o->oargs.farg+3));
>>    if (h <= FTINY)
>>        return;
>>
>> If this test returns 1 (ie. a "flat" cylinder) glPopMatrix() is
>> never called but the system is already translated. This will at least
>> misplace all of the following objects (up to the next 
>> "glLoadIdentity")
>> and it should raise an error when buffers are swaped. IIRC "Pushes"
>> and "Pops" have to match up.
>
> Brilliant, Thomas!  I don't know why I didn't spot this when looking 
> at the code last night -- I did check my push and pop calls, but 
> neglected to look at the error returns.  Indeed, this is a serious 
> bug!  Unfortunately, it doesn't seem to be the one causing all the 
> troubles, as I hopefully tried a fix to it this morning and came up 
> with the same misplaced cylinders in my renderings, but maybe Randolph 
> will have better luck.  I have uploaded both fixes to the CVS tree.
>
> Thanks a lot!
> -Greg
>
> _______________________________________________
> Radiance-general mailing list
> [email protected]
> http://www.radiance-online.org/mailman/listinfo/radiance-general
>
>
>