I succeed to show mutibyte chracter.
the answer is
http://www.horde3d.org/forums/viewtopic.php?f=1&t=1027&hilit=primitives.
Code:
from euclid import Matrix4
self.label = pyglet.text.Label(u'한글Hello, world',
font_name='Gulim', # Gulim font is korean (unicode)
font_size=20, x=200, y=200,
anchor_x='left', anchor_y='center')
def mainloop(self):
self.domy()
w.flip()
h3d.finalizeFrame()
def domy(self):
for w in self._windows:
camNode = w.camera
projMat = h3d.getCameraProjMat(camNode)
glMatrixMode( GL_PROJECTION )
glLoadMatrixf((GLfloat * 16)(*projMat))
glPushMatrix()
glLoadIdentity
glOrtho(0,640,0,480,0,1)
glDisable(GL_DEPTH_TEST)
self.label.draw()
glPopMatrix()
glMatrixMode( GL_MODELVIEW )
glLoadIdentity
glEnable(GL_DEPTH_TEST)
camera = h3d.getNodeTransMats(camNode)
camM = Matrix4()
camM[:]=camera[1][:]
glLoadMatrixf((GLfloat * 16)(*camM.inverse()[:]))
a=h3d.getNodeAABB(self._knight)
[minX, minY, minZ], [maxX, maxY, maxZ] = a[0],a[1]
glColor3f(1.0, 1.0, 1.0)
glBegin(GL_LINE_STRIP)
glVertex3f(minX, minY, minZ)
glVertex3f(maxX, minY, minZ)
glVertex3f(maxX, maxY, minZ)
glVertex3f(minX, maxY, minZ)
glVertex3f(minX, minY, minZ)
glVertex3f(minX, minY, maxZ)
glVertex3f(maxX, minY, maxZ)
glVertex3f(maxX, maxY, maxZ)
glVertex3f(minX, maxY, maxZ)
glVertex3f(minX, minY, maxZ)
glEnd()
glBegin(GL_LINES)
glVertex3f(minX, maxY, minZ)
glVertex3f(minX, maxY, maxZ)
glVertex3f(maxX, minY, minZ)
glVertex3f(maxX, minY, maxZ)
glVertex3f(maxX, maxY, minZ)
glVertex3f(maxX, maxY, maxZ)
glEnd()
pos = h3d.getNodeTransform(self._knight)
glColor3f(1.0, 0.0, 1.0)
glBegin(GL_LINES)
glVertex3f(pos[0][0],pos[0][1],pos[0][2])
glVertex3f(pos[0][0],pos[0][1]-10,pos[0][2])
glEnd()
Attachment:
File comment: hangul is ok
hangul.PNG [ 80.15 KiB | Viewed 13589 times ]
but it has problem.
Attachment:
File comment: invisible
hangul_invisi.PNG [ 101.31 KiB | Viewed 13589 times ]
The Text is invisible by mesh.
How is your think?