|
![](/i/fill.gif) |
> Some interesting ideas though, maybe similar specifications to RIB could be
> used in the parsing of NURBSs (the keywords that is).
Parsing shouldn't be a problem. The hard part is figuring out how to render the
surface. This is the example given in the Renderman Interface Specification:
RIB BINDING
NuPatch nu uorder uknot umin umax nv vorder vknot vmin vmax
parameterlist
EXAMPLE
NuPatch 9 3 [ 0 0 0 1 1 2 2 3 3 4 4 4 ] 0 4
2 2 [ 0 0 1 1 ] 0 1
"Pw" [ 1 0 0 1 1 1 0 1 0 2 0 2
-1 1 0 1 -1 0 0 1 -1 -1 0 1
0 -2 0 2 1 -1 0 1 1 0 0 1
1 0 -3 1 1 1 -3 1 0 2 -6 2
-1 1 -3 1 -1 0 -3 1 -1 -1 -3 1
0 -2 -6 2 1 -1 -3 1 1 0 -3 1 ]
The hardest part of deciding on a POV-Ray interpretation is keeping it compact.
My quick idea:
nurbs_patch {
points <u, v> order <u, v> u_knot {} v_knot {} range <u_min, v_min>, <u_max,
v_max>
control_points {}
}
nurbs_patch {
points <9, 2>
order <3, 2>
u_knot {0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4}
v_knot {0, 0, 1, 1}
range {<0, 2>, <4, 2>
control_points {
<1, 0, 0, 1>, <1, 1, 0, 1>, <0, 2, 0, 2>,
<-1, 1, 0, 1>, <-1, 0, 0, 1>, <-1, -1, 0, 1>,
<0, -2, 0, 2>, <1, -1, 0, 1>, <1, 0, 01>,
<1, 0, -3, 1>, <1, 1, -3, 1>, <0, 2, -6, 2>,
<-1, 1, -3, 1>, <-1, 0, -3, 1>, <-1, -1, -3, 1>,
<0, -2, -6, 2>, <1, -1, -3, 1>, <1, 0, -3, 1>
}
}
And you would probably want a trim_curve section inside nurbs_patch. Anyway,
someone feel like coding this up real quick? ;)
-Mike
Post a reply to this message
|
![](/i/fill.gif) |