当前位置:网站首页>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)
边栏推荐
- 解决ReactNative使用webView存在缓存问题
- 链表中的节点每k个一组翻转
- First hand evaluation of Reza electronics rz/g2l development board
- [AUTOSAR II appl overview]
- Delete duplicate elements in the ordered linked list -ii
- Several cases of recursive processing organization
- MongoDB系列之MongoDB常用命令
- Leetcode-934: the shortest Bridge
- R language ggplot2 visual faceting, visual facet_wrap bar plot, using strip Text function customize the size of the strip of each facet title in the facet graph (cutimi
- 按键精灵打怪学习-多线程后台坐标识别
猜你喜欢
测试右移:线上质量监控 ELK 实战
leetcode:871. Minimum refueling times [Pat has done before + maximum stacking + greed]
MySQL
[case sharing] let the development of education in the new era advance with "number"
拥抱平台化交付的安全理念
[AUTOSAR + IO Architecture]
MySQL basic usage 02
Basic remote connection tool xshell
FPGA - 7 Series FPGA internal structure clocking -04- multi area clock
数学建模之线性规划(含MATLAB代码)
随机推荐
18_ The wechat video number of wechat applet scrolls and automatically plays the video effect to achieve 2.0
Deep analysis of data storage in memory
研发一款国产ARM智能边缘计算网关需要什么
按键精灵打怪学习-回城买药加血
机器学习术语
Daily topic: movement of haystack
kivy教程之在 Kivy App 中使用 matplotlib 的示例
Reading and writing speed of Reza rz/g2l arm development board storage and network measurement
攻克哈希的基本概念与实现
[AUTOSAR I overview]
Test shift right: Elk practice of online quality monitoring
[overview of AUTOSAR three RTE]
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
[overview of AUTOSAR four BSW]
excel去除小数点后面的数据,将数字取整
瑞萨RZ/G2L 处理器简介|框架图|功耗|原理图及硬件设计指南
Several cases of recursive processing organization
Machine learning terminology
[love crash] neglected details of gibaro
What is needed to develop a domestic arm intelligent edge computing gateway