Git Product home page Git Product logo

scn-vr's People

Contributors

mgatelabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scn-vr's Issues

video texture only shows on left cam.

Hi,

I been trying to use this as a 360 video VR player, but it only seems to render the sphere on the left side of the cam. This is what I am doing
`
_player = [[AVPlayer alloc] initWithURL:videoPath];
_videoSpriteKitNode = [SKVideoNode videoNodeWithFileNamed:@"vr.mp4"];
_videoNode = [[SCNNode alloc] init];

[_videoNode setGeometry:[SCNSphere sphereWithRadius:300.f]];

_spriteKitScene = [[SKScene alloc] initWithSize:CGSizeMake(2500, 2500)];
[_spriteKitScene setScaleMode:SKSceneScaleModeAspectFit];
[_videoSpriteKitNode setPosition:CGPointMake(_spriteKitScene.size.width/2, _spriteKitScene.size.height/2)];
[_videoSpriteKitNode setSize:_spriteKitScene.size];

[_spriteKitScene addChild:_videoSpriteKitNode];

[_videoNode.geometry.firstMaterial.diffuse setContents:_spriteKitScene];
[_videoNode.geometry.firstMaterial setDoubleSided:true];

[_videoNode setPosition:SCNVector3Make(0, 0, 0)];
[world addChildNode:_videoNode];`

Am I missing somthing? or anyhow how to make this work?
Thanks!

Only display one scene. and the orientation is incorrect.

Just paste following scene building code into -(SCNScene *) generateScene. And you need to put a 360 degree video into project to run.

SCNScene* scene = [SCNScene scene];
SCNNode* world = [SCNNode node];
[scene.rootNode addChildNode:world];

NSString* path = [[NSBundle mainBundle] pathForResource:@"video_palace" ofType:@"mp4"];
NSURL* url = [NSURL fileURLWithPath:path];
AVPlayerItem* playerItem = [[AVPlayerItem alloc] initWithURL:url];
AVPlayer* player = [AVPlayer playerWithPlayerItem:playerItem];
SKVideoNode* playerNode = [[SKVideoNode alloc] initWithAVPlayer:player];

playerNode.position = CGPointMake(2500 * 0.5, 2500 * 0.5);
playerNode.size = CGSizeMake(2500, 2500);

SKScene* spriteScene = [[SKScene alloc] initWithSize:playerNode.size];
spriteScene.scaleMode = SKSceneScaleModeAspectFit;
[spriteScene addChild:playerNode];

SCNNode* videoNode = [SCNNode new];
videoNode.geometry = [SCNSphere sphereWithRadius:30];
videoNode.geometry.firstMaterial.diffuse.contents = spriteScene;
videoNode.geometry.firstMaterial.doubleSided = TRUE;

SCNMatrix4 matrix = SCNMatrix4MakeRotation(M_PI, 0.0, 0.0, 1.0);
matrix = SCNMatrix4Translate(matrix, 1.0, 1.0, 0.0);
videoNode.pivot = SCNMatrix4MakeRotation(M_PI_2, 0.0, -1.0, 0.0);
videoNode.geometry.firstMaterial.diffuse.contentsTransform = matrix;
videoNode.position = SCNVector3Make(0, 0, 0);
[player play];

[world addChildNode:videoNode];


return scene;

How to enable controls in VRmode

Hi,

I'm unable to see controls in VRMode? Are they disabled in the sample code? Is there any way to enable the controls? Please find attached screenshot. Controls in the screenshot are missing in sample code.

Best,
Prudvee.
img_0016

iOS app will not launch (after some time)

A day or so after the app has been installed, it will stop opening when attempting to launch.
It'll oftern get to the menu screen for a fraction of a second, before closing out back to icon view.
no matter whether I kill the app, hard reset the iphone, nothing fixes this once it starts.

The only remedy is to remove the app and reinstall.
however this comes at much frustration as I must then copy the videos back onto the device each time.

extra info:
I'm using iExplorer to copy videos onto the device (21GB in total)
I have also made custom thumbnails for the videos, replacing the existing PNG's (alpha'ed in the same way)
Running on iPhone 6 plus with 128GB

arm64 error for Hello World Demo

I am getting linking error when i build HelloWorld as

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_AspectDistortionWizardItem", referenced from:
      objc-class-ref in libscn-vr.a(WizardManager.o)

scn-vr library build successfully, however on running HelloWorld gives error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.