Page 1 of 1

Drawing lines in OpenGL mode

Posted: Fri Sep 29, 2006 7:15 pm
by 9792387
The Steema.TeeChart.Drawing.Graphics3D.Line(p0,p1) method doesn't seem to work properly in OpenGL mode. The lines are drawn on the front face of the chart, no matter what the Z value of the points is.

Jay

Posted: Mon Oct 02, 2006 10:46 am
by narcis
Hi Jay,

Thanks for reporting. I've been able to reproduce the issue here and added it (TF02011791) to our bug list to be fixed for future releases. It seems that 3D lines are not drawn properly when initial and final Z values are different.

Posted: Thu Oct 05, 2006 8:45 pm
by 9792387
Hi,

I was using the same Z value for both points, and it was not drawn correctly.

Jay

Posted: Fri Oct 06, 2006 7:53 am
by narcis
Hi Jay,

Which TeeChart version are you using? It works fine here using the latest maintenance release available at the client area.

Posted: Mon Oct 09, 2006 4:26 pm
by 9792387
I am using 2.0.2456.16162. I have tried setting the Z coordinate of the points to 0, TChart1.Aspect.Width3D, and TChart1.Aspect.Width3D/2. All three result in a line on the front of the chart.

Just for clarification, in open GL, would a Z value of 0 be at the front of the chart or the back of the chart?

Jay

Posted: Tue Oct 10, 2006 7:54 am
by narcis
Hi Jay,
I am using 2.0.2456.16162. I have tried setting the Z coordinate of the points to 0, TChart1.Aspect.Width3D, and TChart1.Aspect.Width3D/2. All three result in a line on the front of the chart.

Just for clarification, in open GL, would a Z value of 0 be at the front of the chart or the back of the chart?


Z being zero is the front of the chart. The back of the chart Z value is 100. So this may solve your problem.

If the problem persists please send us an example we can run "as-is" to reproduce the problem here. You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.

Posted: Tue Oct 10, 2006 4:34 pm
by 9792387
I updated to 2.0.2469.25745 and I still have the same results. I have posted sample VB code to the attachments newsgroup. The subject is the same as this thread, "Drawing lines in OpenGL mode".

Jay

Re: Drawing lines in OpenGL mode

Posted: Tue Oct 10, 2006 4:37 pm
by 9792387
I only posted the VB code on the attachments newsgroup because when I tried to zip the whole project directory and attach it I got an error that the post was too large. Would you like the whole thing, just the source code, or some other combination of files?

Jay

Posted: Wed Oct 11, 2006 12:00 pm
by narcis
Hi Jay,

Thanks for the code. With this file was enough to reproduce the problem here. I guess, your problem is very similar to what I said as you use Calc3DPos for converting to 3D points to 2D points. I've included your code to the bug list item to be reviewed.

In the meantime you can use the code below which works fine.

Code: Select all

        For WhichSegment = 1 To TChart1.Series(1).Count - 1 'loop throught the points in the series            
            APoint = New Point(TChart1.Series(1).CalcXPosValue(TChart1.Series(1).XValues(WhichSegment - 1)), TChart1.Series(1).CalcYPosValue(TChart1.Series(1).YValues(WhichSegment - 1)))
            BPoint = New Point(TChart1.Series(1).CalcXPosValue(TChart1.Series(1).XValues(WhichSegment)), TChart1.Series(1).CalcYPosValue(TChart1.Series(1).YValues(WhichSegment)))
            g.Line(APoint, BPoint, 100)
        Next WhichSegment