Dersu's picture

Open Tk - Function graphs with correct axis

Hi All,
I'm using OpenTK with VB.NET to plot a 3D graphs of a 2 variables function. I need to draw some axis around my figures.
I've drawn a wire box around my plot (like this figures taken from Wolfram Mathematica, for example)

but I'm not able to show numbers along axis and resize/reposition them correctly (as in the figure).

Is there any suggestion, please? Thank you!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jrwatts's picture

You could try QuickFont (search for it on this site; I tried including a link to it, but it didn't appear to work).

Dersu's picture

Thank you!
I've another question: how can I find the position of the projection? If I've a point of coordinates (x,y,z) how can I find what position (x-proj,y-proj) it will occupy on the screen?

golkeeper's picture

multiply your coordinates by model, view and projection matrices (you can get them directly from opengl), than perspective divide the result and what you'll get would be normalized device coordinates, with x and y components providing desired position on screen (in -1..1 range)

Dersu's picture

Thank you golkeeper!
I found a partial way but your suggestion complete the solution.