Hi,

I would like to calculate the scale of a pixel. In a program in OpenGL, I hate 
it posted a Function. How can I make it for OSG?


Code:

Public Function get_Massstab() As Double

    Dim modelmatrix(15) As Double
    Dim projMatrix(15) As Double
    Dim viewMatrix(3) As Integer

    Dim tx1 As Double
    Dim ty1 As Double
    Dim tz1 As Double
    Dim tx2 As Double
    Dim ty2 As Double
    Dim tz2 As Double
    Dim dist As Double

    Gl.glGetDoublev(Gl.GL_MODELVIEW_MATRIX, modelmatrix)
    Gl.glGetDoublev(Gl.GL_PROJECTION_MATRIX, projMatrix)
    Gl.glGetIntegerv(Gl.GL_VIEWPORT, viewMatrix)

    gluUnProject(0, 0, 0, modelmatrix, projMatrix, viewMatrix, tx1, ty1, tz1)
    gluUnProject(0, 1, 0, modelmatrix, projMatrix, viewMatrix, tx2, ty2, tz2)

    'einen Pixel
    dist = Math.Sqrt((tx1 - tx2) ^ 2 + (ty1 - ty2) ^ 2 + (tz1 - tz2) ^ 2)
    Return dist

  End Function




Thank you!

Cheers,
Anton[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61462#61462




Attachments: 
http://forum.openscenegraph.org//files/size2_801.png
http://forum.openscenegraph.org//files/size1_776.png


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to