简体   繁体   中英

Does JZY3D-API support “plot3(…)” function in Matlab?

Matlab support 3D line plotting with plot3 function. But I want to do this with JZY3D API. Does JZY3D api support this operation like matlab? If it is, which method does this line plotting? Please help me!!

Thank you

It can be done using LineStrip shape like this:

public class LineTest extends AbstractAnalysis {

    public static void main(String[] args) throws Exception {
        AnalysisLauncher.open(new LineTest());
    }

    @Override
    public void init() throws Exception {
        chart = AWTChartComponentFactory.chart(Quality.Fastest, getCanvasType());
        LineStrip lineStrip = new LineStrip(
            new Point(new Coord3d(0.0, 1.0, 3.0)),
            new Point(new Coord3d(1.0, 2.0, 3.0))
    );
        lineStrip.setWireframeColor(Color.RED);
        chart.getScene().getGraph().add(lineStrip);
    }
}

It shows only 2D plane with line on it, but if you add more 3d-shapes to your scene, you will find out that line is 3-dimensional.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM