Guest User

Untitled

a guest
Jul 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. /* add 63 scnnode to scnview */
  2. for (int index = 0; index < 63; index++) {
  3. NSLog(@"add node {%d}",index);
  4. SCNNode *itemNode = [SCNNode new];
  5. SCNPlane *plane = [SCNPlane planeWithWidth:0.5 height:0.5];
  6. itemNode.geometry = plane;
  7. SKTexture *texture = [SKTexture textureWithImageNamed:@"icon.png"];
  8. SKSpriteNode *picNode = [SKSpriteNode spriteNodeWithTexture:texture];
  9. picNode.xScale = -picNode.xScale;
  10. picNode.zRotation = M_PI;
  11. SKScene *skScene = [SKScene sceneWithSize:CGSizeMake(1, 1)];
  12. [skScene addChild:picNode];
  13. /* use SKScene as node's contents */
  14. itemNode.geometry.firstMaterial.diffuse.contents = skScene;
  15. itemNode.position = SCNVector3Make(0, 1+0.05*index, -3);
  16. [self.jpARSCNView.scene.rootNode addChildNode:itemNode];
  17. }
Add Comment
Please, Sign In to add comment