NURBS and psychophysics toolbox

Hi,

 

I’m trying to use the NURBS toolbox to generate B-splines to be used with the psychophysics toolbox. I’m running into an issue regarding the pointers that are passed to the different functions. If I understand the NURBS toolbox correctly, I need the following sequence of commands to generate a B-spline:

 

nurbs=gluNewNurbsRenderer;

gluBeginCurve(nurbs);

gluNurbsCurve(nurbs, nrknots, knots, nrpoints,ctrlPoints,4,GL.MAP1_VERTEX_3);

gluEndCurve(nurbs);

 

Trying to execute this code, I get an error message that gluNurbsCurve requires a pointer that is an integer. If I make nurbs an integer from the start, then I get the error message that gluBeginCurve needs a pointer that is a float. Am I calling the wrong commands, or how do I fix this issue otherwise? Alternatively, any other suggestions on how to make stimuli based on B-splines with the psychophysics toolbox?

 

Thanks,

 

Kristina

 

 

 

Did you make sure the data types of all inputs are as expected?

gluNurbsCurve(
  GLUnurbs *nobj,
  GLint nknots,
  GLfloat *knot,
  GLint stride,
  GLfloat *ctlarray,
  GLint order,
  GLenum type
);
where unurbs is probably an unsigned int, if i'd have to guess.
Best,
Dee


On Sat, Jun 22, 2013 at 6:14 AM, Kristina Nielsen <nielsen@...> wrote:

Hi,

I’m trying to use the NURBS toolbox to generate B-splines to be used with the psychophysics toolbox. I’m running into an issue regarding the pointers that are passed to the different functions. If I understand the NURBS toolbox correctly, I need the following sequence of commands to generate a B-spline:

nurbs=gluNewNurbsRenderer;

gluBeginCurve(nurbs);

gluNurbsCurve(nurbs, nrknots, knots, nrpoints,ctrlPoints,4,GL.MAP1_VERTEX_3);

gluEndCurve(nurbs);

Trying to execute this code, I get an error message that gluNurbsCurve requires a pointer that is an integer. If I make nurbs an integer from the start, then I get the error message that gluBeginCurve needs a pointer that is a float. Am I calling the wrong commands, or how do I fix this issue otherwise? Alternatively, any other suggestions on how to make stimuli based on B-splines with the psychophysics toolbox?

Thanks,

Kristina