Skip to content

how to add additional objects? #1

@r03ert0

Description

@r03ert0

hello,
thank you for SimpleOculus! it was just what i needed to start going with OVR and cocoa.

One question. I tried to add a cube to the panorama, but the interpupillary distance was awkward... what is the appropriate way of adding objects? This is what I added to Scene.mm, to try to display a cube:

void Scene::render() {
    drawPanorama();

    int     i,j;
    GLfloat o[3]={0,0,-5};
    GLfloat P[]={   0,0,0,  1,0,0,  1,1,0,  0,1,0,
                    0,0,1,  1,0,1,  1,1,1,  0,1,1};
    GLfloat C[]={   0,0,0,  1,0,0,  1,1,0,  0,1,0,
                    0,0,1,  1,0,1,  1,1,1,  0,1,1};
    GLint   T[]={   0,1,2, 0,2,3,
                    1,5,6, 1,6,2,
                    5,4,7, 5,7,6,
                    4,0,3, 4,3,7,
                    3,2,6, 3,6,7,
                    0,4,1, 1,4,5};
    for(i=0;i<8*3;i++)
        P[i]=(P[i]-0.5)*1;

    glBegin(GL_TRIANGLES);
    for(i=0;i<12;i++)
        for(j=0;j<3;j++) {
            glColor4f(C[T[3*i+j]*3+0],C[T[3*i+j]*3+1],C[T[3*i+j]*3+2],1);
            glVertex3f(o[0]+P[T[3*i+j]*3+0],o[1]+P[T[3*i+j]*3+1],o[2]+P[T[3*i+j]*3+2]);
        }
    glEnd();
}

Also... the cube renders all squished...

thank you in advance for your help!
roberto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions