|
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.; } } } } }
|
|