Reputation: 377
I need is a single line rendered from within PsychToolBox in Matlab. So:
glBegin(GL.LINES);
glVertex3f(0, 0, 0);
glVertex3f(1, 1, 1);
glEnd;
Returns:
??? The class "GL" is undefined. Perhaps Java is not running.
I'm using the code provided here.
However, I substituted GL_LINES with GL.LINES to fit psychtoolbox convention (naturally, tried it both ways).
Upvotes: 0
Views: 373
Reputation: 78
I had a similar issue when I added a subfunction that was fixed by making GL a global variable:
function parent()
global GL
InitializeMatlabOpenGL(0);
...
function child()
...
end
end
Upvotes: 3
Reputation: 377
I neglected to mention that the above lines were run from a subfunction. Whenever this is done, apparently I need to explicitly pass the "GL" structure from the function that runs Screen('BeginOpenGL'). Let me know if anyone else experiences the above issue, and if you need more details about this answer.
Upvotes: 1