NURB render error?

NURB render error?

Post by Brian Gree » Tue, 30 Jan 1996 04:00:00



##RenderMan RIB
version 3.03
#
# Could anyone explain what is wrong with this cubic NURB?
# I am expecting the grid lines to be evenly spaced in U
# Note that I calculated closure of an open knot vector
#               U0 U1 U2 U3
#                   as
#         U2 U3 U0 U1 U2 U3 U0
# Note that I have tried
#         U3 U2 U0 U1 U2 U3 U0
#

#
Display "NURB.1.pic" "framebuffer" "rgba"
PixelSamples 2 2
PixelFilter "sinc" 3 3
Sides 2
Format 500 400 1.066
Projection "perspective" "fov" [43.6164]
Clipping 0.1 32768
Scale -1 1 1
Rotate -5.71055 1 0 0
Rotate 180 0 1 0
Translate 0 -0.582937 -8.2702
WorldBegin
#
# Note that the shader for grid is:
# surface grid()
# {
#   Oi = 0.5;
#   Ci = Oi*texture("/usr/local/prman/prman/lib/textures/grid.tex", s, t);
# }
#
Surface "grid"
NuPatch 7 4 [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1] 0 1 4 4 [0 0 0 0 1 1 1 1] 0 1 "P"
[
#V one
 0  -3  2 # U 2
 2  -3  0 # U 3
 0  -3 -2 # U 0
-2  -3  0 # U 1
 0  -3  2 # U 2
 2  -3  0 # U 3
 0  -3 -2 # U 0

#V two
 0  -2  2
 2  -2  0
 0  -2 -2
-2  -2  0
 0  -2  2
 2  -2  0
 0  -2 -2

#V three
 0  -1  2
 2  -1  0
 0  -1 -2
-2  -1  0
 0  -1  2
 2  -1  0
 0  -1 -2

#V four
 0   0  2
 2   0  0
 0   0 -2
-2   0  0
 0   0  2
 2   0  0
 0  -0 -2
]
WorldEnd

--
+-------------------------------------------------------------------------+
| ANIMAL LOGIC RESEARCH 123 Willoughby Rd, Crows Nest, NSW 2065 AUSTRALIA |

+-------------------------------------------------------------------------+

 
 
 

NURB render error?

Post by Antoine Du » Tue, 30 Jan 1996 04:00:00


: ##RenderMan RIB
: version 3.03
: #
: # Could anyone explain what is wrong with this cubic NURB?
: # I am expecting the grid lines to be evenly spaced in U
: # Note that I calculated closure of an open knot vector
: #               U0 U1 U2 U3
: #                   as
: #         U2 U3 U0 U1 U2 U3 U0
: # Note that I have tried
: #         U3 U2 U0 U1 U2 U3 U0
: #

: #
: Surface "grid"

Your NuPatch had...

  7 4 [0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1] 0 1

when what you probably wanted was

  7 4 [-.75 -.5 -.25 0 .25 .5 .75 1 1.25 1.5 1.75] 0 1

The trick is that the "0 1" at the end of the array isn't the bounds of
the array -- it's the portion of the patch that is actually rendered.  In
fact, "0 1" is not valid for this patch direction, as "0 1" doesn't fit
the requirement uknot(uorder-1) <= umin <= umax <= uknot(nu), on page 104
or the _RC_.  Thus, for the above patch, "0 1" should have been ".3 .7",
since that is as much as gets rendered.  All I did was fit ".3 .7" out to
"0 1", and thus the whole grid.tex is rendered.
  PRMan should have complained when the patch uvmin/max was incorrectly
set.  Instead, it clamps, which can then lead to further
mis-interpretations when you get to TrimCurves.  I believe this is being
fixed for release 3.6 (due shortly).

-- Antoine

P.S. Note that your tube isn't round.

_______________________________________________________________________________


_______________________________________________________________________________