view matrix (camera)

Help
mumin16
2013-07-23
2013-07-23
  • mumin16

    mumin16 - 2013-07-23

    Hi guys! for view matrix, anybody can help me? Thanks!

     
    Last edit: mumin16 2013-07-24
  • mumin16

    mumin16 - 2013-07-23

    //for opengl
    //projection
    glm::mat4 projection = glm::perspective( glm::degrees(cam->mHorizontalFOV), cam->aspect, cam->near, cam->far);

    //model
    std::string name= scene->mMeshes[index]->mName.C_Str();
    aiMatrix4x4 m1 = scene->mRootNode->FindNode(name.data())->mTransformation;
    glm::mat4 model;
    memcpy(&model,&m1, 16*sizeof(GLfloat));

    //view
    aiCamera cam=scene->mCameras[0];
    aiMatrix4x4 m2 = scene->mRootNode->FindNode(cam->mName)->mTransformation;
    glm::mat4 view;
    memcpy(&view,&m2, 16
    sizeof(GLfloat));

    //MVP matrix
    MVP=projection view model;

    //result is blank screen..

     
    Last edit: mumin16 2013-07-26

Log in to post a comment.