Axis captions in OpenGL
Posted: Tue Aug 28, 2012 9:07 am
Hi
I have been making a 3D OpenGL plot. The axis caption titles for the Depth and Right Axes are not plotted in the correct position (I believe this is a know bug). Hence I am trying to custom draw these titles using an after draw. The problem is I cannot figure out how to accurately find the position of the axes on the plot. Currently I am using for the Depth axis caption :
This puts the Caption in the right place for the Depth Axis but the X position is too far to the right and the Y position is too high.
What is the correct method for calculating the X and Y values (should be bottom right corner of plot) for use in the routine TextOut3D.
Thanks Frank
I have been making a 3D OpenGL plot. The axis caption titles for the Depth and Right Axes are not plotted in the correct position (I believe this is a know bug). Hence I am trying to custom draw these titles using an after draw. The problem is I cannot figure out how to accurately find the position of the axes on the plot. Currently I am using for the Depth axis caption :
Code: Select all
procedure TCapPressFuncXplot.Draw3DAxisLabels;
Var
fTchart : TChart;
fCanvas : TCanvas3D;
x, y, z : Integer;
begin
fTchart := XplotChartFrm.Chart1;
fCanvas := fTchart.Canvas;
fCanvas.Font.Size := fTchart.DepthAxis.Title.Font.Size;
fCanvas.Font.Color := fTchart.DepthAxis.Title.Font.Color;
x := fTchart.ChartWidth - fTchart.MarginLeft;
y := fTchart.ChartHeight - fTchart.MarginTop;
Z := fTchart.Width3D div 2;
fCanvas.TextOut3D(X,Y,Z,fTchart.DepthAxis.Title.Caption);
end;
What is the correct method for calculating the X and Y values (should be bottom right corner of plot) for use in the routine TextOut3D.
Thanks Frank