welcome to linkAR technical documentation

next previous

Camera Settings

6.1- Camera

    NSArray * camPos = [NSArray arrayWithObjects:
                        FBOX(0.0f),
                        FBOX(30.0f),
                        FBOX(175.0f), nil];
 
    NSArray * camTargetPos = [NSArray arrayWithObjects:
                              FBOX(0.0f),
                              FBOX(5.0f),
                              FBOX(0.0f), nil];
 
    // Set inicial camera position in the scene.
    if(![glView setCameraPosition:camPos])
        NSLog(@"Error setting camera position");
 
    // Set initial camera target position in the scene.
    if(![glView setCameraTargetPos:camTargetPos])
        NSLog(@"Error setting camera target position");

Another way to control the camera is through the camera rotation matrix:

CC3GLMatrix *modelMatrix = [CC3GLMatrix matrix];
    CC3Vector v;
    v.x = 100.0;
    v.y = 100.0;
    v.z = 100.0;
    [modelMatrix populateFromTranslation:v];
 
    NSArray * m = [NSArray arrayWithObjects:
                   FBOX(modelMatrix.glMatrix[0]), FBOX(modelMatrix.glMatrix[1]), FBOX(modelMatrix.glMatrix[2]), FBOX(modelMatrix.glMatrix[3]),
                   FBOX(modelMatrix.glMatrix[4]), FBOX(modelMatrix.glMatrix[5]), FBOX(modelMatrix.glMatrix[6]), FBOX(modelMatrix.glMatrix[7]),
                   FBOX(modelMatrix.glMatrix[8]), FBOX(modelMatrix.glMatrix[9]), FBOX(modelMatrix.glMatrix[10]), FBOX(modelMatrix.glMatrix[11]),
                   FBOX(modelMatrix.glMatrix[12]), FBOX(modelMatrix.glMatrix[13]), FBOX(modelMatrix.glMatrix[14]), FBOX(modelMatrix.glMatrix[15]),
                   nil];
 
 
 
    if(![glView setCameraRotation:m])
        NSLog(@"Error setting camera position");
 

You can find additional information here next previous