Jump to content

  • Log In with Google      Sign In   
  • Create Account


GDITexture - 3D


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 buk110   Members   -  Reputation: 100

Like
0Likes
Like

Posted 10 August 2011 - 02:54 PM

I'm currently trying to draw some text in a 3D Application and am having zero luck.

Currently, I'm using the ESRI ArcGlobe control which is a 3D Globe. I've inserted that inside of a control that inherits from OpenGLControl so I can have access to the override void glDraw()

I'm trying the following code but no such luck. NOTE: Most of this code comes from the sample gdiFont.cs file

GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
GL.glLoadIdentity();
GL.glTranslated(0,0,-1000);
GL.glRotated(35 , 1, 1.2 , 0.2);
GL.glScaled(2,2,2);

GL.glPushMatrix();
GL.glColor3f(1,0,0);
GL.glRotated(180,0,1,0);

myFont.DrawString("TEST");


Any ideas? Anyone ever do something like this before where a control is chaining inheritance?

Sponsor:

#2 Caste   Moderators   -  Reputation: 969

Like
0Likes
Like

Posted 10 August 2011 - 08:16 PM

The code itself looks fine, you'd have to give us more information about the inheritance part, probably both classes, and what exactly do you mean by "no luck", does it crash? does anything appear on the screeen?

#3 buk110   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 August 2011 - 06:52 AM

The code itself looks fine, you'd have to give us more information about the inheritance part, probably both classes, and what exactly do you mean by "no luck", does it crash? does anything appear on the screeen?



Sure, by no luck I mean nothing shows up on the screen. My inheritance is like this:

ArcGlobeControl : MapControl
MapControl : OpenGLControl


In ArcGlobeControl I do the following

public override void glDraw()
{
GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
GL.glLoadIdentity();
GL.glTranslated(0,0,-1000);
GL.glRotated(35 , 1, 1.2 , 0.2);
GL.glScaled(2,2,2);

GL.glPushMatrix();
GL.glColor3f(1,0,0);
GL.glRotated(180,0,1,0);

myFont.DrawString("TEST");
}

What's really odd is that I have a separate class, called DataLayer that a Instantiate inside of the GlobeControl and in that I have the following
protected void SetupOpenGL()
{
   myGlobeDisplayEvents = myGlobeControl.GlobeViewer.GlobeDisplay;

   myGlobeDisplayEvents.AfterDraw += MyHandler();
}


private void MyHandler(ISceneViewer inSceneViewer)
{
 //GL Drawing code
  // GL Draw a huge box
  // WOW I HAVE A 3D box that shows up on the globe
}

However, inside that class I can never seem to create a GDITextureFont. It does create one in the ArcGlobeControl , but not in the DataLayer.

Any thoughts?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS