Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* add 63 scnnode to scnview */
- for (int index = 0; index < 63; index++) {
- NSLog(@"add node {%d}",index);
- SCNNode *itemNode = [SCNNode new];
- SCNPlane *plane = [SCNPlane planeWithWidth:0.5 height:0.5];
- itemNode.geometry = plane;
- SKTexture *texture = [SKTexture textureWithImageNamed:@"icon.png"];
- SKSpriteNode *picNode = [SKSpriteNode spriteNodeWithTexture:texture];
- picNode.xScale = -picNode.xScale;
- picNode.zRotation = M_PI;
- SKScene *skScene = [SKScene sceneWithSize:CGSizeMake(1, 1)];
- [skScene addChild:picNode];
- /* use SKScene as node's contents */
- itemNode.geometry.firstMaterial.diffuse.contents = skScene;
- itemNode.position = SCNVector3Make(0, 1+0.05*index, -3);
- [self.jpARSCNView.scene.rootNode addChildNode:itemNode];
- }
Add Comment
Please, Sign In to add comment