IOS 学习AR(3)( 3D引擎 SceneKit SCNGeometry)

本文详细介绍了在iOS的AR开发中,如何使用SceneKit创建各种几何体,包括SCNBox立方体、SCNPlane平面、SCNPyramid锥形、SCNSphere球体等,并给出了创建和应用材质的示例代码。
摘要由CSDN通过智能技术生成

SCNGeometry几何体类型

1.SCNBox 立方体


代码:(下面只介绍几何体创建)

//盒子

SCNBox *box = [SCNBox boxWithWidth:10 height:10 length:10 chamferRadius:0];

//材质(贴图后面章节说贴图)

    SCNMaterial *allMaterial1 = [SCNMaterial new];

    allMaterial1.diffuse.contents =[UIImage imageNamed:@"1"];

    SCNMaterial *allMaterial2 = [SCNMaterial new];

    allMaterial2.diffuse.contents =[UIImage imageNamed:@"2"];

    SCNMaterial *allMaterial3 = [SCNMaterial new];

    allMaterial3.diffuse.contents =[UIImage imageNamed:@"3"];

    SCNMaterial *allMaterial4 = [SCNMaterial new];

    allMaterial4.diffuse.contents =[UIImage imageNamed:@"4"];

    SCNMaterial *allMaterial5 = [SCNMaterial new];

    allMaterial5.diffuse.contents =[UIImage imageNamed:@"5"];

    SCNMaterial *allMaterial6 = [SCNMaterial

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值