Skip to main content
GameDev.net gamedev.net
🔒 Locked

3d Font

Started by Scooter Jul 1, 2004 at 6:38 PM 4 replies 850+ views
Original Post
Scooter
Scooter
When I try to add 3D Font to my program it screws up everything. It appears that it flips all my normals or starts rendering all the triangles in the opposite direction. How can I fix this? This code seems to be the problem: .... .... glListBase(nFontList); glCallLists(6,GL_UNSIGNED_BYTE,"MY TEXT"); ... ...
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
benjamin bunny
benjamin bunny
Why are you passing a string to the lists parameter of glCallLists?

Quote:
From MSDN:
const GLvoid *lists
The address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of type.
Scooter
Scooter
Because that is the type of the third parameter in the definition of glCallLists()
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
kburkhart84
kburkhart84
Quote:
Original post by Scooter
Because that is the type of the third parameter in the definition of glCallLists()


I don't think that the line you looked at is the problem.

glListBase(mylist);
glCallLists(strlen(mytext), GL_UNSIGNED_BYTE, mytext);

In my 3d font class, after being setup, does the same as yours.
The first parameter is the length of the text, the second what type it is, the third which ones it'll pick from the list. What I did notice is that you set the first parameter to 6, but the string "MY TEXT" has seven characters, space counts as a character. Check that and if it doesn't work, let me know.


Scooter
Scooter
That length isn't the problem. But those lines of code, or something about them is because if I comment them out everything works normally.
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
kburkhart84
kburkhart84
You did the code in Visual C++?? If so send me the source and I will look at it. From what you say, it should work.
kburkhart84@sbcglobal.net


Topic Locked

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

Sign in to reply to this topic.