Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions ScanDepthRender.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/* Begin PBXBuildFile section */
6F482D9118CE1C4E00C11D9E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A6ABFC3418C8FF5000BF0851 /* Main.storyboard */; };
8B2EB8821C15B81700715157 /* Structure.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B2EB8811C15B81700715157 /* Structure.framework */; };
8B2EB8841C15CBB100715157 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B2EB8831C15CBB100715157 /* libz.tbd */; };
A6ABFC1F18C8FF5000BF0851 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6ABFC1E18C8FF5000BF0851 /* Foundation.framework */; };
A6ABFC2118C8FF5000BF0851 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6ABFC2018C8FF5000BF0851 /* CoreGraphics.framework */; };
A6ABFC2318C8FF5000BF0851 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6ABFC2218C8FF5000BF0851 /* UIKit.framework */; };
Expand Down Expand Up @@ -37,8 +39,6 @@
A6ABFC7318CA470200BF0851 /* SDRPointCloudRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = A6ABFC7218CA470200BF0851 /* SDRPointCloudRenderer.m */; };
A6ABFC7A18CA511200BF0851 /* PointCloudShader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = A6ABFC7418CA4DE600BF0851 /* PointCloudShader.vsh */; };
A6ABFC7B18CA511200BF0851 /* PointCloudShader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A6ABFC7518CA4DE600BF0851 /* PointCloudShader.fsh */; };
A6D60CD7196B0954008C0A0F /* Structure.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6D60CD6196B0954008C0A0F /* Structure.framework */; };
A6D60CD8196B0954008C0A0F /* Structure.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6D60CD6196B0954008C0A0F /* Structure.framework */; };
A6D60CDA196B0AEE008C0A0F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6D60CD9196B0AEE008C0A0F /* QuartzCore.framework */; };
/* End PBXBuildFile section */

Expand All @@ -53,6 +53,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
8B2EB8811C15B81700715157 /* Structure.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Structure.framework; sourceTree = "<group>"; };
8B2EB8831C15CBB100715157 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
A68D07DB18CBBF430050B9D7 /* AnimationControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimationControl.h; sourceTree = "<group>"; };
A6ABFC1B18C8FF5000BF0851 /* ScanDepthRender.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScanDepthRender.app; sourceTree = BUILT_PRODUCTS_DIR; };
A6ABFC1E18C8FF5000BF0851 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -91,7 +93,6 @@
A6ABFC7218CA470200BF0851 /* SDRPointCloudRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDRPointCloudRenderer.m; sourceTree = "<group>"; };
A6ABFC7418CA4DE600BF0851 /* PointCloudShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PointCloudShader.vsh; path = Shaders/PointCloudShader.vsh; sourceTree = "<group>"; };
A6ABFC7518CA4DE600BF0851 /* PointCloudShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PointCloudShader.fsh; path = Shaders/PointCloudShader.fsh; sourceTree = "<group>"; };
A6D60CD6196B0954008C0A0F /* Structure.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Structure.framework; sourceTree = "<group>"; };
A6D60CD9196B0AEE008C0A0F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

Expand All @@ -100,14 +101,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8B2EB8841C15CBB100715157 /* libz.tbd in Frameworks */,
8B2EB8821C15B81700715157 /* Structure.framework in Frameworks */,
A6D60CDA196B0AEE008C0A0F /* QuartzCore.framework in Frameworks */,
A6ABFC6D18C93F3F00BF0851 /* AVFoundation.framework in Frameworks */,
A6ABFC1F18C8FF5000BF0851 /* Foundation.framework in Frameworks */,
A6ABFC6C18C902AE00BF0851 /* Accelerate.framework in Frameworks */,
A6ABFC2718C8FF5000BF0851 /* OpenGLES.framework in Frameworks */,
A6ABFC6818C9027B00BF0851 /* ImageIO.framework in Frameworks */,
A6ABFC6618C9024E00BF0851 /* CoreMedia.framework in Frameworks */,
A6D60CD7196B0954008C0A0F /* Structure.framework in Frameworks */,
A6ABFC6418C9023E00BF0851 /* CoreImage.framework in Frameworks */,
A6ABFC6218C9023100BF0851 /* ExternalAccessory.framework in Frameworks */,
A6ABFC5F18C9022000BF0851 /* CoreMotion.framework in Frameworks */,
Expand All @@ -122,7 +124,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A6D60CD8196B0954008C0A0F /* Structure.framework in Frameworks */,
A6ABFC4618C8FF5000BF0851 /* XCTest.framework in Frameworks */,
A6ABFC4818C8FF5000BF0851 /* UIKit.framework in Frameworks */,
A6ABFC4718C8FF5000BF0851 /* Foundation.framework in Frameworks */,
Expand Down Expand Up @@ -154,8 +155,9 @@
A6ABFC1D18C8FF5000BF0851 /* Frameworks */ = {
isa = PBXGroup;
children = (
8B2EB8831C15CBB100715157 /* libz.tbd */,
8B2EB8811C15B81700715157 /* Structure.framework */,
A6D60CD9196B0AEE008C0A0F /* QuartzCore.framework */,
A6D60CD6196B0954008C0A0F /* Structure.framework */,
A6ABFC6B18C902AE00BF0851 /* Accelerate.framework */,
A6ABFC6918C9029100BF0851 /* AVFoundation.framework */,
A6ABFC2018C8FF5000BF0851 /* CoreGraphics.framework */,
Expand Down Expand Up @@ -271,7 +273,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = SDR;
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "Nigel Choi";
TargetAttributes = {
A6ABFC4318C8FF5000BF0851 = {
Expand Down Expand Up @@ -400,6 +402,8 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -439,6 +443,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down Expand Up @@ -467,6 +472,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ScanDepthRender/ScanDepthRender-Prefix.pch";
INFOPLIST_FILE = "ScanDepthRender/ScanDepthRender-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.9gel.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -485,6 +491,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ScanDepthRender/ScanDepthRender-Prefix.pch";
INFOPLIST_FILE = "ScanDepthRender/ScanDepthRender-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.9gel.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -507,6 +514,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "ScanDepthRenderTests/ScanDepthRenderTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.9gel.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand All @@ -526,6 +534,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ScanDepthRender/ScanDepthRender-Prefix.pch";
INFOPLIST_FILE = "ScanDepthRenderTests/ScanDepthRenderTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.9gel.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand Down
2 changes: 2 additions & 0 deletions ScanDepthRender/SDRExampleRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//

#import <GLKit/GLKit.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>

@interface SDRExampleRenderer : NSObject

Expand Down
2 changes: 1 addition & 1 deletion ScanDepthRender/SDRExampleRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ - (GLKViewDrawableDepthFormat)drawableDepthFormat

- (void)updateWithBounds:(CGRect)bounds timeSinceLastUpdate:(NSTimeInterval)timeSinceLastUpdate
{
float aspect = fabsf(bounds.size.width / bounds.size.height);
float aspect = std::abs(bounds.size.width / bounds.size.height);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f);

self.effect.transform.projectionMatrix = projectionMatrix;
Expand Down
4 changes: 3 additions & 1 deletion ScanDepthRender/SDRPointCloudRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//

#import <GLKit/GLKit.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#import <Structure/StructureSLAM.h>

@interface SDRPointCloudRenderer : NSObject
Expand All @@ -22,6 +24,6 @@
modelView:(GLKMatrix4)modelView
invScale:(float)invScale;
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect;
- (void)updatePointsWithDepth:(STFloatDepthFrame*)depthFrame image:(CGImageRef)image;
- (void)updatePointsWithDepth:(STDepthFrame*)depthFrame image:(CGImageRef)image;

@end
4 changes: 2 additions & 2 deletions ScanDepthRender/SDRPointCloudRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
glDrawArrays(GL_POINTS, NUM_TEST_POINTS, (GLsizei)(_cols*_rows));
}

- (void)updatePointsWithDepth:(STFloatDepthFrame*)depthFrame image:(CGImageRef)imageRef;
- (void)updatePointsWithDepth:(STDepthFrame*)depthFrame image:(CGImageRef)imageRef;
{
if (imageRef)
{
Expand All @@ -203,7 +203,7 @@ - (void)updatePointsWithDepth:(STFloatDepthFrame*)depthFrame image:(CGImageRef)i
if (depthFrame)
{
float *data = (GLfloat *)_pointsData.mutableBytes;
const float *depths = [depthFrame depthAsMillimeters];
const float *depths = [depthFrame depthInMillimeters];

for (int r = 0; r < _rows; r++)
{
Expand Down
2 changes: 1 addition & 1 deletion ScanDepthRender/SDRViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
@property (weak,nonatomic) IBOutlet UILabel* statusLabel;
@property (weak,nonatomic) IBOutlet UIImageView* depthImageView;
@property (weak,nonatomic) IBOutlet UIImageView* cameraImageView;

@property (nonatomic, retain) AVCaptureDevice *videoDevice;
@end
Loading