-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed Leap Motion example. Added a chessboard rendering example, …
…although it isn't fully functional.
- Loading branch information
1 parent
8c01228
commit cf4931d
Showing
18 changed files
with
4,982 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
408 changes: 408 additions & 0 deletions
408
examples/ChessboardTest/ChessboardTest.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
examples/ChessboardTest/OculusSceneKit/ChessboardTest-Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>${MACOSX_DEPLOYMENT_TARGET}</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2013 Sunset Lake Software LLC. All rights reserved.</string> | ||
<key>NSMainNibFile</key> | ||
<string>MainMenu</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
</dict> | ||
</plist> |
7 changes: 7 additions & 0 deletions
7
examples/ChessboardTest/OculusSceneKit/ChessboardTest-Prefix.pch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// | ||
// Prefix header for all source files of the 'OculusSceneKit' target in the 'OculusSceneKit' project | ||
// | ||
|
||
#ifdef __OBJC__ | ||
#import <Cocoa/Cocoa.h> | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#import <Cocoa/Cocoa.h> | ||
#import "OculusRiftSceneKitView.h" | ||
|
||
@interface SLSAppDelegate : NSObject <NSApplicationDelegate> | ||
|
||
@property(assign) IBOutlet NSWindow *window; | ||
@property(assign) IBOutlet OculusRiftSceneKitView *oculusView; | ||
|
||
- (IBAction)increaseIPD:(id)sender; | ||
- (IBAction)decreaseIPD:(id)sender; | ||
- (IBAction)increaseDistance:(id)sender; | ||
- (IBAction)decreaseDistance:(id)sender; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#import "SLSAppDelegate.h" | ||
|
||
@implementation SLSAppDelegate | ||
|
||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | ||
{ | ||
// Insert code here to initialize your application | ||
|
||
SCNScene *scene = [SCNScene scene]; | ||
|
||
SCNNode *objectsNode = [SCNNode node]; | ||
[scene.rootNode addChildNode:objectsNode]; | ||
|
||
objectsNode.scale = SCNVector3Make(0.02, 0.02, 0.02); | ||
objectsNode.position = SCNVector3Make(0, -300.0, -250); | ||
objectsNode.rotation = SCNVector4Make(1, 0, 0, -M_PI/2); | ||
|
||
// Chess model is from the WWDC 2013 Scene Kit presentation | ||
SCNScene *chessboardScene = [SCNScene sceneNamed:@"chess"]; | ||
SCNNode *chessboardNode = [chessboardScene.rootNode childNodeWithName:@"Line01" recursively:YES]; | ||
NSLog(@"Chess node: %@", chessboardNode); | ||
[objectsNode addChildNode:chessboardNode]; | ||
|
||
SCNNode *bishop = [chessboardNode childNodeWithName:@"bishop" recursively:YES]; | ||
bishop.geometry.firstMaterial.reflective.intensity = 0.7; | ||
bishop.geometry.firstMaterial.fresnelExponent = 1.5; | ||
|
||
SCNNode *L = [chessboardNode childNodeWithName:@"L" recursively:YES]; | ||
L.geometry.firstMaterial.reflective.intensity = 0.7; | ||
L.geometry.firstMaterial.fresnelExponent = 1.5; | ||
|
||
// Create a diffuse light | ||
SCNLight *diffuseLight = [SCNLight light]; | ||
diffuseLight.color = [NSColor colorWithDeviceRed:0.1 green:0.1 blue:0.1 alpha:0.5]; | ||
SCNNode *diffuseLightNode = [SCNNode node]; | ||
diffuseLight.type = SCNLightTypeOmni; | ||
diffuseLightNode.light = diffuseLight; | ||
diffuseLightNode.position = SCNVector3Make(200.0, 400.0, -100); | ||
[scene.rootNode addChildNode:diffuseLightNode]; | ||
|
||
// Create a top-down spotlight | ||
SCNLight *spotLight = [SCNLight light]; | ||
SCNNode *spotLightNode = [SCNNode node]; | ||
spotLight.type = SCNLightTypeSpot; | ||
spotLightNode.light = diffuseLight; | ||
spotLightNode.position = SCNVector3Make(0, 300, -250); | ||
spotLightNode.rotation = SCNVector4Make(1, 0, 0, M_PI_2); | ||
[spotLight setAttribute:@30 forKey:SCNLightShadowNearClippingKey]; | ||
[spotLight setAttribute:@50 forKey:SCNLightShadowFarClippingKey]; | ||
[spotLight setAttribute:@10 forKey:SCNLightSpotInnerAngleKey]; | ||
[spotLight setAttribute:@45 forKey:SCNLightSpotOuterAngleKey]; | ||
[scene.rootNode addChildNode:spotLightNode]; | ||
|
||
self.oculusView.scene = scene; | ||
[self.oculusView setBackgroundColorRed:0.0 green:0.0 blue:0.0 alpha:1.0]; | ||
|
||
// Have this start in fullscreen so that the rendering matches up to the Oculus Rift | ||
[self.window toggleFullScreen:nil]; | ||
} | ||
|
||
|
||
- (IBAction)increaseIPD:(id)sender; | ||
{ | ||
self.oculusView.interpupillaryDistance = self.oculusView.interpupillaryDistance + 2.0; | ||
} | ||
|
||
- (IBAction)decreaseIPD:(id)sender; | ||
{ | ||
self.oculusView.interpupillaryDistance = self.oculusView.interpupillaryDistance - 2.0; | ||
} | ||
|
||
- (IBAction)increaseDistance:(id)sender; | ||
{ | ||
SCNVector3 currentLocation = self.oculusView.headLocation; | ||
currentLocation.z = currentLocation.z - 50.0; | ||
self.oculusView.headLocation = currentLocation; | ||
} | ||
|
||
- (IBAction)decreaseDistance:(id)sender; | ||
{ | ||
SCNVector3 currentLocation = self.oculusView.headLocation; | ||
currentLocation.z = currentLocation.z + 50.0; | ||
self.oculusView.headLocation = currentLocation; | ||
} | ||
|
||
@end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.