wglUseFontBitmaps 未在屏幕上绘制
我之前已经在 gis.stackexchange 中发布了这个问题,但我不确定这实际上是否是发布它的正确位置,因为这更多是一个编码/技术问题。我正在尝试在 3D 空间中绘制一个角色。然而,似乎没有什么可以将这个角色放置在屏幕上。
以下是我尝试在代码中执行的操作:有人有任何想法吗?我现在已经迷失了方向,并且承认我对 openGL 几乎一无所知
double outX = 0;
double outY = 0;
double outZ = 0;
//This allows ArcGlobe to convert a lat lon into a 3D Coordinate system between -1 and 1
myGlobeViewUtil.GeographictoGeocentric(0 ,0 ,0 , out outX , out outY , out outZ);
Font font = new Font("Courier New" , 32.0f , FontStyle.Bold);
uint dbase = GL.genLists(256);
wglUseFontBitmaps(this.Handle, 32, 256 , dbase);
GL.glLoadIdentity();
GL.glTranslatef(0.0f , 0.0f , -1.0f);
GL.glColor3f(1.0f , 0.0f , 0.0f);
GL.glRasterPos3d(geoX , geoY , geoZ);
GLPrint("TEST");
private void GLPrint(string inText)
{
GL.glPushAttrib(GL.GL_LIST_BIT);
GL.glListBase(dbase -32);
GL.glCallLists(text.length , GL.GL_UNSIGNED_SHORT , text);
GL.glPopattrib();
}
编辑:由于预先存在的要求,我必须使用 CsGL http://csgl.sourceforge.net/
I've posted this question in gis.stackexchange earlier but I'm not sure if that was in fact the right place to post it, since this is more of a coding/technical question. I'm attempting to draw a character in 3D Space. However, nothing seems to place the character on the screen.
Below is what I'm attempting to do in code: Anyone have any ideas? I'm beyond lost at this point and will admit that I know next to nothing about openGL
double outX = 0;
double outY = 0;
double outZ = 0;
//This allows ArcGlobe to convert a lat lon into a 3D Coordinate system between -1 and 1
myGlobeViewUtil.GeographictoGeocentric(0 ,0 ,0 , out outX , out outY , out outZ);
Font font = new Font("Courier New" , 32.0f , FontStyle.Bold);
uint dbase = GL.genLists(256);
wglUseFontBitmaps(this.Handle, 32, 256 , dbase);
GL.glLoadIdentity();
GL.glTranslatef(0.0f , 0.0f , -1.0f);
GL.glColor3f(1.0f , 0.0f , 0.0f);
GL.glRasterPos3d(geoX , geoY , geoZ);
GLPrint("TEST");
private void GLPrint(string inText)
{
GL.glPushAttrib(GL.GL_LIST_BIT);
GL.glListBase(dbase -32);
GL.glCallLists(text.length , GL.GL_UNSIGNED_SHORT , text);
GL.glPopattrib();
}
EDIT: Due to pre-existing requirements I must use CsGL
http://csgl.sourceforge.net/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
现在终于可以用了!
完整的工作示例:http://cl.ly/2Z2m0A2v2U3p1j1m1p00
Finally now it works!
Complete working example: http://cl.ly/2Z2m0A2v2U3p1j1m1p00