RenderMan & RISpec >> Curve Normals?

by noizFACTORY@gmail.com » Thu, 29 May 2008 14:11:45 GMT

Hello all,

I just started getting into renderman and was interested in doing a
test for using curves as textured ribbons. While that part wasn't so
hard to figure out, what is kind of bothering me is that the curves
always seem to face the camera (like sprite particles do).

While this is expected, it won't let me achieve the desired effect. I
searched through the net for info and what I learnt was that I need to
export surface normals data for the curves to orient them correctly at
render time. Is that possible for curves? If so, how would I go about
doing that?

I would really appreciate it if anyone can point me in the right
direction (relevant reading materials or papers are also fine).

Best,
Sachin

RenderMan & RISpec >> Curve Normals?

by Olivier3001 » Thu, 29 May 2008 20:53:32 GMT


On May 29, 2:11 am, " XXXX@XXXXX.COM " < XXXX@XXXXX.COM >


Just like other primitives, you attach the "N" variable to it:
Curves "cubic" [4] "nonperiodic"
"P" [-0 0 0 -0.2 1 0 0.2 2 0 -0.1 3 0]
"N" [0.3 0 -1 0.7 0 -1]

Note that N is varying, not vertex.

RenderMan & RISpec >> Curve Normals?

by noizFACTORY@gmail.com » Fri, 30 May 2008 17:15:10 GMT


Thank you for the reply Olivier.

For a curve system generated by a package like Shave and A Haircut or
Maya Hair, how do you think I can go about attaching the N variable to
the output curves? Would I do that using the delightGeoAttributes node
(as I'm using 3dfm)?
I'm looking to replicate the following method that's suggested in the
MayaMan help docs:

The special name Width is specified then the curve is given width data
that will change over the length of the curve. If you use the special
name Normal then the curve is given normal data. All other names are
passed unfiltered. Vector arrays, other than Normal, are passed as an
array of colors which is convenient when the data name is Cs,
conversion to any other data type is trivial to handle in the shader.

To set width and normal data on a open nurbs curve with 5 control
points execute a mel script like this:

setAttr MayaManAttributes1.MayaManCurveWidth -type doubleArray 5 1 2
3 2 1
setAttr MayaManAttributes1.MayaManCurveNormal -type vectorArray 5 0 1
0 0 0 1 0 -1 0 0 0 -1 0 1 0

-Sachin

Similar Threads

1. Need Curve/Curve intersection algorithm

I have a set of 2D discrete points (Xi, Yi) forming a curve segment
along a semi-horizontal line, and another set of points (Xj, Yj)
forming a curve
cutting across the previous curve. I want to find their intersection.

Could anyone please kindly send me a C code to  XXXX@XXXXX.COM  for
that?

2. How to find point on Bezier curve located on given distance from the start of curve

3. Quad Bezier curves to Cubic bezier curves.


Hi all,

   Hope this is th right group fro this question.

   I'm writing a java program that needs to convert some quadratic 
bezier curves to cubic bezier curves.  I hope this is possible... I'm a 
strong programmer but its been a while since if been in a math class so 
its not obvious to me how to do this.

   Can anyone point me in the right direction?  Also is it even possible 
to do this.

   Thanks.

   Glen


4. What approach for curve smoothing ( smoothing and oversampling a pixellated curve )

5. Curve radius from bezier curve (segment)

Hi there,

In my application the user can bent bezier curves with 3 or 4 control
points to almost any arbitrary shape.

What I need to display to the user is the (approximated) radius of the
largest circle, or rather circle arc, for which (at least a part of)
the bezier curve is the tangent. This may sound a bit confusing, a
small graphic may be helpful:
www.barnholt.net/Bezier_to_radius.png

A naive algorithm would start on either end of the bezier curve and
work its way forward along the curve, using a circle with a certain
max. radius and gradually decrease the circle radius until the bezier
curve is tangent of part of the circle.

But I'm sure, there's an intelligent way to solve the problem :-)

Any ideas are welcome!


regards,
Jan Barnholt

6. curve fitting - selecting the right type of curve

7. Bezier curve to NURBS curve

Greetings,

I'm pretty sure that a Bezier curve can be represented exactly by a
NURBS curve. However what I need is an algorithm to convert Bezier
curves (Quadratic and Cubic) to a NURBS curve. If I'm not mistaken, it
should involve manipulating the knots while using the same control
points. I've seen an algorithm or two on the web but they seem to fail
most of the time.
Can you lead me in the right direction?

Thanks,
Abdo Haji-Ali
Programmer
In|Framez

8. Demo for 2D AA lines, curves filled curves ?