Article: 27910 of comp.graphics.rendering.renderman
Path: uni-berlin.de!fu-berlin.de!news.belwue.de!rz.uni-karlsruhe.de!news.rz.uni-karlsruhe.de!not-for-mail
From: Matthias Baas
Newsgroups: comp.graphics.rendering.renderman
Subject: Power basis bug in every renderer except RDC?
Date: Sat, 22 Jan 2005 17:27:59 +0100
Organization: University of Karlsruhe, Germany
Lines: 93
Message-ID:
NNTP-Posting-Host: i31p12.ibds.uni-karlsruhe.de
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: news2.rz.uni-karlsruhe.de 1106411187 8723 141.3.42.162 (22 Jan 2005 16:26:27 GMT)
X-Complaints-To: usenet@rz.uni-karlsruhe.de
NNTP-Posting-Date: Sat, 22 Jan 2005 16:26:27 +0000 (UTC)
X-Newsreader: Forte Agent 1.9/32.560
Xref: uni-berlin.de comp.graphics.rendering.renderman:27910
Hi,
I have a question about the application of the Power basis for curves
primitives. Just for the sake of demonstrating the different
representations for a curve I converted a Bezier curve into Power
representation. However, when rendering such a curve I get different
results depending on what renderer I'm using. I tried 3Delight, Aqsis,
Pixie, PRMan (thanks to Dan Maas!) and the demo versions of Air and
RenderDotC. Only RDC rendered the curve as expected. PRMan, 3Delight
and Pixie each produced the same result, but I would say the result is
wrong (but I admit that it's odd that three independent renderers
should have the same bug in their code). So here's what I did, maybe
it's something wrong with my math:
I have the following Bezier control points:
b1 = (0,0)
b2 = (0,1)
b3 = (1,1)
b4 = (1,0)
The resulting curve is
c(t) = T * B_Bez * P_Bez
where T=(t^3, t^2, t, 1), B_Bez is the Bezier basis and P_Bez is a
matrix that contains the above control points (the first row is b1,
the second row b2 and so on).
Now I want the same curve, but using the Power basis:
c(t) = T * B_Pow * P_Pow
B_Pow is the Power basis, i.e. the identity, which means P_Pow
has to be
P_Pow = B_Bez * P_Bez
So the new control points for the Power curve are
p1 = (-2,0)
p2 = (3,-3)
p3 = (0,3)
p4 = (0,0)
But as I said above, only RDC agrees with me on this result...
Can it really be that PRMan, 3Delight and Pixie all have the same bug?
Why is it that other basis matrices do work and produce the same
expected result and only the Power basis doesn't work? Do the
renderers have specialized code for the various basis matrices?
Here is a RIB that renders the curves (the yellow polygon is the
bezier control polygon b1,b2,b3,b4. The grey curve is the Bezier curve
and the red curve is the Power curve which is supposed to be identical
with the grey curve).
Maybe it's not the math but there's something wrong with my RIB?
-------------------------------------------------------------------
PixelSamples 2 2
Format 320 240 1
Display "out.tif" "framebuffer" "rgb"
Scale 1.5 1.5 1.5
Translate -0.5 -0.55 5
WorldBegin
Surface "constant"
Color 1 1 1
# White background
Patch "bilinear" "P" [-2 2 1 2 2 1 -2 -2 1 2 -2 1]
# Control polygon
Color 0.8 0.8 0.5
Curves "linear" [4] "nonperiodic" "P" [0 0 0 0 1 0 1 1 0 1 0 0]
"constantwidth" [0.01]
# Power basis
Color 0.9 0.3 0.3
Basis "bezier" 3 "power" 4
Curves "cubic" [4] "nonperiodic" "P" [-2 0 0 3 -3 0 0 3 0 0 0 0]
"constantwidth" [0.02]
# Bezier basis
Translate 0 0 0.1
Color 0.8 0.8 0.8
Basis "bezier" 3 "bezier" 3
Curves "cubic" [4] "nonperiodic" "P" [0 0 0 0 1 0 1 1 0 1 0 0]
"constantwidth" [0.01]
WorldEnd
-------------------------------------------------------------------
- Matthias -
Answer from Olivier Paquet:
Hi,
Your math seems quite correct to me. There is indeed a bug with
3Delight and since it's a fairly 'natural' bug to make I can easily
imagine that other renderers have the exact same one. The problem is
that the control points are transformed before the basis conversion
takes place. This works fine for curves and surfaces under the bspline,
bezier and catmull-rom basis but not for the power basis (and I imagine
the hermite basis too). Just imagine applying a translation to the t^3
term and you'll get the picture.
Olivier Paquet
------
3Delight development team