当前位置:网站首页>Swiftui component Encyclopedia: using scenekit and swiftui to build interactive 3D pie charts (tutorial with source code)
Swiftui component Encyclopedia: using scenekit and swiftui to build interactive 3D pie charts (tutorial with source code)
2022-07-03 01:16:00 【Knowledge fatness】
Use of this month SceneKit structure 3D It is very meaningful to do the same for pie charts . besides , This is also a careful study SceneKit A good opportunity for other aspects of the framework .
code
I started like this … Of course , Search for a good SCNShape Implementation example . The first goal is to build slices using the basic code described here .
Please note that , Even though Apple Call this a Bessel path —— It seems to be just a path .
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)
边栏推荐
- excel表格计算时间日期的差值,并转化为分钟数
- MySQL foundation 06 DDL
- MongoDB系列之MongoDB常用命令
- Explain the basic concepts and five attributes of RDD in detail
- Excel removes the data after the decimal point and rounds the number
- RISA rz/g2l processor introduction | frame diagram | power consumption | schematic diagram and hardware design guide
- Several cases of recursive processing organization
- Canvas drawing -- bingdd
- Merge K sorted linked lists
- Draw love with go+ to express love to her beloved
猜你喜欢
随机推荐
异步、郵件、定時三大任務
2022 Jiangxi Provincial Safety Officer B certificate reexamination examination and Jiangxi Provincial Safety Officer B certificate simulation examination question bank
递归处理组织的几种情况
R language uses coin package to apply permutation tests to independence problems (permutation tests, whether response variables are independent of groups, are two numerical variables independent, and
1696C. Fishingprince plays with array [thinking questions + intermediate state + optimized storage]
[AUTOSAR XIII NVM]
MongoDB系列之MongoDB常用命令
Leetcode 6103 - minimum fraction to delete an edge from the tree
(C语言)数据的存储
MySQL foundation 04 MySQL architecture
First hand evaluation of Reza electronics rz/g2l development board
MySQL basic usage 02
On Fibonacci sequence
Embrace the safety concept of platform delivery
[system analyst's road] Chapter V double disk software engineering (development model development method)
matlab查找某一行或者某一列在矩阵中的位置
Database SQL language 01 where condition
2022 coal mine gas drainage examination question bank and coal mine gas drainage examination questions and analysis
删除有序链表中重复的元素-II
【系统分析师之路】第五章 复盘软件工程(开发模型开发方法)