Common talks Objective-C

How to create geometry in SceneKitКак создать геометрию в SceneKit

Small code example, how to create 3D Geometry in SceneKit from scratch. Apple didnt provide any samples, so i hope this will be useful for someone.

SCNNode *myNode = [SCNNode nodeWithGeometry:[self createGeometry]];

- (SCNGeometry *) createGeometry{

NSArray *sources = @[
[SCNGeometrySource geometrySourceWithVertices: (SCNVector3[]){
{.x = -1.0f, .y = -1.0f, .z = 0.0f},
{.x = -1.0f, .y = 1.0f, .z = 0.0f},
{.x = 1.0f, .y = 1.0f, .z = 0.0f},
{.x = 1.0f, .y = -1.0f, .z = 0.0f}
} count:4],
[SCNGeometrySource geometrySourceWithNormals:(SCNVector3[]){
{.x = 0.0f, .y = 0.0f, .z = -1.0f},
{.x = 0.0f, .y = 0.0f, .z = -1.0f},
{.x = 0.0f, .y = 0.0f, .z = -1.0f},
{.x = 0.0f, .y = 0.0f, .z = -1.0f}
} count:4],
[SCNGeometrySource geometrySourceWithTextureCoordinates:(CGPoint[]){
{.x = 0.0f, .y = 0.0f},
{.x = 0.0f, .y = 1.0f},
{.x = 1.0f, .y = 1.0f},
{.x = 1.0f, .y = 0.0f}
} count:4]

NSArray *elements = @[
[SCNGeometryElement geometryElementWithData:[NSData dataWithBytes:(short[]){0, 2, 3,0,1,2} length:sizeof(short[6])]

SCNGeometry *geo = [SCNGeometry geometryWithSources:sources elements:elements];

SCNMaterial *mat = [SCNMaterial material];
mat.diffuse.contents = [NSColor redColor];

geo.firstMaterial = mat;
geo.firstMaterial.doubleSided = YES;

return geo;



Common talks Objective-C

Grab2Drop approved in AppStoreGrab2Drop заапрувили в AppStore

Grab2Drop was approved in AppStore. I’m happy! )




Pro version coming soon.Grab2Drop появился в AppStore. Я счастлив! )




Скоро допилю Pro версию.

Common talks Objective-C Others

Grab2Drop – share screenshots via Dropbox

On NewYear holidays i wrote small Mac OSX Application – Grab2Drop.


It save your screenshot to Dropbox and give back URL to it. Easy way to share screenshots with friends.

I setup small site for it –

Hope, you will find it helpful. Post your comments and suggestions please. Maybe bug reports? )))