找回密码
 立即注册
收起左侧

qml用datavisualization画三维曲面图的问题

2
回复
5189
查看
[复制链接]

尚未签到

来源: 2019-4-8 17:01:15 显示全部楼层 |阅读模式
1Qter豆
用qml里面的Surface3D画一个球面,给的是完整球面的数据,画出的只有半个球面,原因同一对(x,y)对应两个不同的z值,貌似就只能画出一个来,查了帮助文档,看到里面有一个multiMathBehavior属性,也是只能选择画第一个或者最后一个或者二者的平均值,不能两个同时画,求教怎用用一个数据序列画出完整的球面?

代码如下:
        
    Surface3D {        id: surface3D        anchors.right: parent.right        anchors.bottom: parent.bottom        width: parent.width/3        height: parent.height/2.25        polar: true        aspectRatio: 1        scene.activeCamera.zoomLevel:160
        axisX:ValueAxis3D {            segmentCount: 8            labelFormat: "%i\u00B0"            title: "Angle"            titleVisible: true            titleFixed: false        }        axisY: ValueAxis3D {            segmentCount: 8            labelFormat: "%.2f"            title: "Value"            titleVisible: true            labelAutoRotation: 0            titleFixed: false        }        axisZ:ValueAxis3D {            id: zAxis            segmentCount: 5            labelFormat: "%.2f"            title: "Radius"            titleVisible: true            titleFixed: false        }


        Surface3DSeries {            itemLabelFormat: "(@xLabel, @zLabel): @yLabel"            ItemModelSurfaceDataProxy {                rowRole: "radius"                columnRole: "angle"                yPosRole: "value"                //multiMatchBehavior:ItemModelSurfaceDataProxy.MMBLast                //itemModel: ListModel {id:surfaceData}                itemModel: ListModel{                    id:surfaceData                    ListElement{ radius: 0; angle: 0; value: 100.; }                    ListElement{ radius: 0; angle: 72; value: 100.; }                    ListElement{ radius: 0; angle: 144; value: 100.; }                    ListElement{ radius: 0; angle: 216; value: 100.; }                    ListElement{ radius: 0; angle: 288; value: 100.; }                    ListElement{ radius: 0; angle: 360; value: 100.; }                    ListElement{ radius: 58.8; angle: 0; value: 80.; }                    ListElement{ radius: 58.8; angle: 72; value: 80.; }                    ListElement{ radius: 58.8; angle: 144; value: 80.; }                    ListElement{ radius: 58.8; angle: 216; value: 80.; }                    ListElement{ radius: 58.8; angle: 288; value: 80.; }                    ListElement{ radius: 58.8; angle: 360; value: 80.; }                    ListElement{ radius: 95.1; angle: 0; value: 31.; }                    ListElement{ radius: 95.1; angle: 72; value: 31.; }                    ListElement{ radius: 95.1; angle: 144; value: 31.; }                    ListElement{ radius: 95.1; angle: 216; value: 31.; }                    ListElement{ radius: 95.1; angle: 288; value: 31.; }                    ListElement{ radius: 95.1; angle: 360; value: 31.; }
                    ListElement{ radius: 0; angle: 0; value: -100.; }                    ListElement{ radius: 0; angle: 72; value: -100.; }                    ListElement{ radius: 0; angle: 144; value: -100.; }                    ListElement{ radius: 0; angle: 216; value: -100.; }                    ListElement{ radius: 0; angle: 288; value: -100.; }                    ListElement{ radius: 0; angle: 360; value: -100.; }                    ListElement{ radius: 58.8; angle: 0; value: -80.; }                    ListElement{ radius: 58.8; angle: 72; value: -80.; }                    ListElement{ radius: 58.8; angle: 144; value: -80.; }                    ListElement{ radius: 58.8; angle: 216; value: -80.; }                    ListElement{ radius: 58.8; angle: 288; value: -80.; }                    ListElement{ radius: 58.8; angle: 360; value: -80.; }                    ListElement{ radius: 95.1; angle: 0; value: -31.; }                    ListElement{ radius: 95.1; angle: 72; value: -31.; }                    ListElement{ radius: 95.1; angle: 144; value: -31.; }                    ListElement{ radius: 95.1; angle: 216; value: -31.; }                    ListElement{ radius: 95.1; angle: 288; value: -31.; }                    ListElement{ radius: 95.1; angle: 360; value: -31.; }                }            }        }    }

附件: 您需要 登录 才可以下载或查看,没有帐号?立即注册
回复

使用道具 举报

尚未签到

2019-4-8 17:05:01 显示全部楼层
第一次发帖,代码好乱,发个截图吧C:\Users\fpchi\Desktop\1.jpg

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

累计签到:742 天
连续签到:1 天
2019-4-8 18:06:52 显示全部楼层
很厉害了,加油 ~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了