0
$\begingroup$

I’m trying add strafe function in my program, i tried everything i can but still i was unable to get desire output! Can anyone please tell me how can i add strafe function in my program?..

is there anyone who uses Blender (3d modeling/animation software)....if you use blender.....then do you know how center point or looking point of camera changes while panning....! that's what i'm trying to add in my program.......

here is how my camera function look like:

glTranslatef(xtrans, ytrans, -5);
glRotatef(updateY, 1, 0, 0);
glRotatef(updateX, 0, 1, 0);
glTranslatef(-1, -1, 0);

here is my input…

void MouseMove(int MouseX, int MouseY)
{
    if (panning == true)
    {
        changeAngleX_pan = (MouseX - xOrigin_pan);
        changeAngleY_pan = (MouseY - yOrigin_pan);
        ndc_x = changeAngleX_pan * 2.0f / 500;      //ndc_x = No direction change in x-field
        ndc_y = -changeAngleY_pan * 2.0f / 500;     //ndc_y = No direction change in y-field

        xtrans = ndc_x1 + ndc_x;
        ytrans = ndc_y1 + ndc_y;
    }
    else
    {
        changeAngleX = (MouseX - xOrigin);
        changeAngleY = (MouseY - yOrigin);
        updateX = angleX + changeAngleX;
        updateY = angleY + changeAngleY;
    }
    Display();
}

....to view full code Click here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.