|
3D Charts with Primitive drawing methods |
Posted by Sal on Jul-17-2015 01:59 |
|
HI Peter,
I searched the 3D charts in the attempt to locate a base class like "DrawArea" is for "XYChart" to produce 3D primitives objects drawing
Q1: Is such class present/accessible in CD V6 c++ ?
Q2: Any example containing C++ code of 3D charts (any flavor) which viewing angle and Zoom factor is changed via Mouse actions like your 2d Tracker samples illustrates ?
Thanks
Sal |
Re: 3D Charts with Primitive drawing methods |
Posted by Sal on Jul-17-2015 21:36 |
|
Hello again,
Sorry I missed to produce an answer on Q1 on my own:
More careful browsing of ThreeDScatterChart class made me notice the presence of the DrawArea class I was looking for additional drawing over the 3D chart
So, I rework that question with this:
Q1: Can I replace some layers of scattered points drawn as isolated points using symbol of my choice, with a series of interconnecting segment with area filling ?
How would I do this ?
FYI: the points series are arranged in a sort of CW ordered sequence of points, so this should not create a graphical issue
Q2: Can you elaborate on the DrawArea class usage differences in ThreeDScatterChart 3D graph class obtained by using the following methods:
getDrawArea() and makeChart3() ?
Q3: I still could use a 3D plot sample of some kind where we can change the appearance of the 3D graph by using the mouse to rotate image Horizontally Left to Right, Elevation angle of view, Zoom factor with mouse wheel.
I would like to tie the above operation with something you did for the XY Zoom and Scrolling (MFC) where you controls the image appearance with a ViewPort control
Can this be done, when the image I was control is a chart other the XY Chart ?
Intuition is telling me that I can use something similar to the sample I mentioned above, but I am not sure
Thanks as always for your great hints and help.
This is what impressed of CD support
Sal |
Re: 3D Charts with Primitive drawing methods |
Posted by Peter Kwan on Jul-18-2015 08:33 |
|
Hi Sal,
Q1. The DrawArea operates at the pixel level. There are no 3D primitives at the pixel
level. At this level, the "frame buffer" (eg. you can imagine it as the screen) are always
2D.
You can always draw any symbol using the symbol of your choice. For example, if you
have 100 types of different symbols for your data points, just separate the points into
100 groups, and then use addScatterGroup to add them to the chart.
In the ThreeDChart object in ChartDirector 6, there area APIs that can translate from 3D
data (x, y, z) coordinates to pixel coordinates (which is necessary 2D). See:
http://www.advsofteng.com/doc/cdcpp.htm#ThreeDChart.getXCoor.htm
http://www.advsofteng.com/doc/cdcpp.htm#ThreeDChart.getYCoor.htm
You can then use those coordinates in DrawArea to draw lines or fill the polygon.
Q2. The getDrawArea method returns the DrawArea when you call it, and you can use
the DrawArea to draw on the chart surface. If you use the DrawArea object before you
call makeChart (or any API that actually draws the chart onto the frame buffer), then the
things you draw can be covered by other chart objects when you call makeChart. So this
method is most useful if you want to draw on the background.
The makeChart3 draws the chart onto the frame buffer and then return the DrawArea, so
that you can draw additional things on top of the chart.
Q3: Unluckily, ChartDirector does not come with a ViewPort control in 3D.
Regards
Peter Kwan |
|