当前位置:网站首页>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)边栏推荐
- 按键精灵打怪学习-自动寻路回打怪点
- Compare version number
- 按鍵精靈打怪學習-多線程後臺坐標識別
- 安全运营四要素之资产、脆弱性、威胁和事件
- 合并K个已排序的链表
- Explain the basic concepts and five attributes of RDD in detail
- Advanced pointer (I)
- Leetcode-1964: find the longest effective obstacle race route to each position
- tail -f 、tail -F、tailf的区别
- Deep analysis of data storage in memory
猜你喜欢
![[AUTOSAR nine c/s principle Architecture]](/img/59/ce32c0ff58ef5d8385fe950136175b.png)
[AUTOSAR nine c/s principle Architecture]

Linear programming of mathematical modeling (including Matlab code)

异步、郵件、定時三大任務

Deep analysis of data storage in memory

JS inheritance and prototype chain
![[case sharing] let the development of education in the new era advance with](/img/11/af88d16dc66f00840cbfc5ba5d68bd.jpg)
[case sharing] let the development of education in the new era advance with "number"

【无标题】

Leetcode-2280: represents the minimum number of line segments of a line graph

Reading and writing speed of Reza rz/g2l arm development board storage and network measurement

Trois tâches principales: asynchrone, courrier et timing
随机推荐
Specified interval inversion in the linked list
异步、郵件、定時三大任務
R language generalized linear model function GLM, (model fit and expression diagnostics), model adequacy evaluation method, use plot function and car package function
FPGA - 7 Series FPGA internal structure clocking -04- multi area clock
MySQL multi table joint deletion
[flutter] icons component (load the built-in icon of flutter | display the material design icon completely)
Excel if formula determines whether the two columns are the same
[AUTOSAR 11 communication related mechanism]
链表中的节点每k个一组翻转
Draw love with go+ to express love to her beloved
Initial order of pointer (basic)
How wide does the dual inline for bread board need?
Linear programming of mathematical modeling (including Matlab code)
Leetcode-224: basic calculator
按键精灵打怪学习-自动回城路线的判断
Esp32 simple speed message test of ros2 (limit frequency)
无向图的割点
Compare version number
[AUTOSAR nine c/s principle Architecture]
1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]