Interpolate (CameraPos - CameraLookAt)
#1

So I've been trying to make some house preview system by making the cameras flying from house to house. Normally, using InterpolateCameraPos and LookAt is not that hard but it comes more complicated when you want to make things look more accurate.

I want to make so from house 1 the camera will fly to the sky and then to house 2 instead of flying straight to house 2; this is because I want to avoid camera passing thru objects. Lets say I have 3 houses. When I go to the house preview my camera just uses the normal SetCameraPos and LookAt instead of the Interpolate one since we start from house 1 and we're not flying from other house. Then by clicking next, camera should fly to the sky and then to house 2. Same from house 2, sky and house 3.

How would you do this and in it's best way?

My idea was to make something like this:

pawn Код:
enum e_CLASS_CAMERA_DATA
{
    e_CLASS_CAMERA_ID,
    e_CLASS_CAMERA_FLY_POS_X[3], //In this case my X stands for InterpolateCameraPos
        e_CLASS_CAMERA_FLY_POS_Y[3] // In this case my Y stands fro InterpolateCameraLookat
};

new const flyCameraData[MAX_FLY_CAMERAS][e_CLASS_CAMERA_DATA] =
{
    {0, {2496.1621, -1709.6810, 1014.7422}, {2496.1621, -1709.6810, 1014.7422}}, // House 1
    {1, {2496.1621, -1709.6810, 1014.7422}, {2496.1621, -1709.6810, 1014.7422}}, //From house 1, fly to the sky
    {2, {2496.1621, -1709.6810, 1014.7422}, {2496.1621, -1709.6810, 1014.7422}} //From the sky to house 2

};

// The coords above don't matter since it's just an example array


So I made something like this for the camera positions. I don't know if there is a better way, you tell me.

Also I'd like to know how would I fly from the sky to house 2, continue the camera ID 1 to fly to camera ID 2.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)