Giter Site home page Giter Site logo

Comments (7)

rsanchezsaez avatar rsanchezsaez commented on July 16, 2024 1

It seems this have been resolved. Can this issue be closed? :)

from cardboardsdk-ios.

rsanchezsaez avatar rsanchezsaez commented on July 16, 2024 1

I'm closing this issue now, let me know if there are any more issues.

In case it helps, a CBDSceneKit example project has just been added, demonstrating usage of the CardboardSDK with SceneKit+SpriteKit.

from cardboardsdk-ios.

CacheLine avatar CacheLine commented on July 16, 2024

Hi Ijfdestiny,
I have been trying render an SCNScene into GLKView's EAGLContext using the SCNRenderer, but it only renders black. I made a SceneKit replacement for the TreasureRenderer in the sample code as a test. The same scene renders into an SCNView, even one using the same EAGLContext.

- (void)setupRendererWithView:(GLKView *)glView
{
         [EAGLContext setCurrentContext:glView.context];
         self.renderer =  [SCNRenderer rendererWithContext:glView.context options:nil];
         self.renderer.scene = self.scene;
   ...

Did you manage to get a scene rendered into the Cardboard EAGLContext?

from cardboardsdk-ios.

ljfdestiny avatar ljfdestiny commented on July 16, 2024

Hi CacheLine,maybe you forgotten to call [renderer render] in drawEyeWithEye:(CBDEye *)eye ?

from cardboardsdk-ios.

CacheLine avatar CacheLine commented on July 16, 2024

Thanks Ijfdestiny, I just triple checked. Nothing as easy as that :-(
I had also tried calling [renderer renderAtTime:] since they say [renderer render] is deprecated. It didn't help.

from cardboardsdk-ios.

ljfdestiny avatar ljfdestiny commented on July 16, 2024

How about the view matrix and perspective of the cameraNode,did you tramsform then to SCNMatrix format?

  • (void)drawEyeWithEye:(CBDEye *)eye
    {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    _view = GLKMatrix4Multiply([eye eyeViewMatrix], _camera);
    _perspective = [eye perspectiveMatrixWithZNear:_zNear zFar:_zFar];

    cameraNode.transform = SCNMatrix4FromGLKMatrix4(GLKMatrix4Transpose(_view));

    [cameraNode.camera setProjectionTransform:SCNMatrix4FromGLKMatrix4(_perspective)];

    [_renderer render];
    }

from cardboardsdk-ios.

CacheLine avatar CacheLine commented on July 16, 2024

Thank you IjfDestiny!
I was neglecting the glClear, without which everything was black. I also missed the setProjectionTransform, and most annoyingly, the use of the transpose of the GL matrix to get the node transform.
Thank you again

from cardboardsdk-ios.

Related Issues (20)

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.