Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 22 Oct 2012
Offline Last Active Oct 22 2012 02:35 PM

Topics I've Started

OpenTK projection of 3d points....

22 October 2012 - 02:03 PM

I'm learning OpenTK for some simple 3D work. I'm able to setup a simple scene showing basic shapes. However OpenTK does not have a project() function to allow me to place 2D text into a 3D scene. I'm attempting to use the following project() function but getting odd results.

Private Function Project13(world As Vector3) As Vector3
Dim view(4) As Integer
Dim model(16) As Double
Dim proj(16) As Double
Dim Screen As Vector3
GL.GetInteger(GetPName.Viewport, view)
GL.GetDouble(GetPName.ModelviewMatrix, model)
GL.GetDouble(GetPName.ProjectionMatrix, proj)
OpenTK.Graphics.Glu.Project(world, model, proj, view, Screen)
Screen.Y = GlControl1.Height - Screen.Y
Return Screen
End Function

3D math isn't my strong point, but can anyone suggest what might be amiss?