当前位置:网站首页>SwiftUI 组件大全之使用 SceneKit 和 SwiftUI 构建交互式 3D 饼图(教程含源码)
SwiftUI 组件大全之使用 SceneKit 和 SwiftUI 构建交互式 3D 饼图(教程含源码)
2022-07-03 00:51:00 【知识大胖】
本月对使用 SceneKit 构建 3D 饼图进行同样的处理是非常有意义的。除此之外,这也是仔细研究 SceneKit 框架的其他一些方面的一个很好的机会。
编码
我开始如此…当然,搜索一个很好的SCNShape实现示例。第一个目标是使用此处说明的基本代码构建切片。
请注意,尽管 Apple 称这是一条贝塞尔路径——它似乎只不过是一条路径。
let coreNode = SCNNode()
coreNode.simdPosition = SIMD3(x:0,y:0,z:0)
scene?.rootNode.addChildNode(coreNode)
coreNode.simdPivot.columns.3.z = 1
bezierPath3.move(to: CGPoint(x: 0, y: 0))
let radians = Double(startAngle) * Double.pi / 180.0
let x = Double(center.x) + Double(radius.width) * Double(cos(radians))
let y = Double(center.y) + Double(radius.height) * sin(radians)
bezierPath3.addLine(to: CGPoint(x: x, y: y))
let radians3 = Double(endAngle/2) * Double.pi / 180.0
let x3 = Double(center.x) + Double(radius.width) * Double(cos(radians3))
let y3 = Double(center.y) + Double(radius.height)
边栏推荐
- Kivy教程大全之如何在 Kivy 中创建下拉列表
- [shutter] animation animation (shutter animation type | the core class of shutter animation)
- [AUTOSAR 11 communication related mechanism]
- Advanced pointer (I)
- What is needed to develop a domestic arm intelligent edge computing gateway
- JS inheritance and prototype chain
- MySQL basic usage 02
- Basic use of sringcloud & use of component Nacos
- matlab查找某一行或者某一列在矩阵中的位置
- (C language) data storage
猜你喜欢
[AUTOSAR eight OS]
[untitled]
【C语言】分支和循环语句(上)
飞凌搭载TI AM62x的ARM核心板/开发板首发上市,亮相Embedded World 2022
Advanced pointer (I)
matlab将数字矩阵保存为地理空间数据出错,显示下标索引必须为正整数类型或逻辑类型,解决
[shutter] image component (configure local GIF image resources | load placeholder with local resources)
合并K个已排序的链表
[AUTOSAR I overview]
Explain the basic concepts and five attributes of RDD in detail
随机推荐
465. DFS backtracking of optimal bill balance
The R language uses the ctree function in the party package to build conditional inference decision trees, uses the plot function to visualize the trained conditional inference decision tree, and the
RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
信息熵的基础
[AUTOSAR 11 communication related mechanism]
[case sharing] let the development of education in the new era advance with "number"
删除有序链表中重复的元素-II
Advanced pointer (I)
1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]
Reading and writing speed of Reza rz/g2l arm development board storage and network measurement
这不平凡的两年,感谢我们一直在一起!
Leetcode-934: the shortest Bridge
[love crash] neglected details of gibaro
Array and collection performance comparison
matlab 多普勒效应产生振动信号和处理
1038 Recover the Smallest Number
按键精灵打怪学习-自动寻路回打怪点
excel去除小数点后面的数据,将数字取整
Button wizard play strange learning - go back to the city to buy medicine and add blood
按键精灵打怪学习-自动回城路线的判断