Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

glVertexAttribPointer

Started by Geometrian Dec 6, 2008 at 7:56 PM 4 replies 2.7k views
Original Post
Geometrian
Geometrian
Hello, I'm having trouble with glVertexAttribPointer(). My current code, in Python is:
location = glGetAttribLocation(program,"vert_tangent")
glVertexAttribPointer(location,3,GL_FLOAT,GL_FALSE,0,vectors)
I'm getting a type error in the last argument; the trouble is in "vectors". I've tried vectors in either a list form or a list of lists form, so when vectors is in the form:

vectors = [,,,,,,,,,,,,,,,,,,,, ... ] #doesn't work
vectors = [[,,],[,,],[,,],[,,], ... ] #also doesn't work
What format should "vectors" be in then? Thanks, -G
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]
HuntsMan
HuntsMan
Type error? Is that a compiler error? In what language?
Geometrian
Geometrian
The exact error is: "ArgumentError: argument 6: : wrong type"
The language, as I mentioned, is Python.
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]
NumberXaero
NumberXaero
Are you calling glEnableVertexAttribArray(location) before?
Geometrian
Geometrian
Yes.
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]
Geometrian
Geometrian
OK, I got it working. For future reference, if the list can be make into an (n by 3) Numeric array, the pointer can be found with array.tostring()
[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.