Skip to main content
added 6 characters in body
Source Link
Blau
  • 3.4k
  • 17
  • 19

You should first scale and rotate, and then translate:

        Vector3 objPos = new Vector3(0, -50, 0);
        Vector3 camPos = objPos - Vector3.One * cameraDistance;
        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation(objPos) *
                  Matrix.CreateLookAt(camPos, obsPos, Vector3.Up);

EDITED: Because camera was placed where object was not.

You should first scale and rotate, and then translate:

        Vector3 objPos = new Vector3(0, -50, 0);
        Vector3 camPos = objPos - Vector3.One * cameraDistance;
        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation() *
                  Matrix.CreateLookAt(camPos, obsPos, Vector3.Up);

EDITED: Because camera was placed where object was not.

You should first scale and rotate, and then translate:

        Vector3 objPos = new Vector3(0, -50, 0);
        Vector3 camPos = objPos - Vector3.One * cameraDistance;
        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation(objPos) *
                  Matrix.CreateLookAt(camPos, obsPos, Vector3.Up);

EDITED: Because camera was placed where object was not.

added 86 characters in body
Source Link
Blau
  • 3.4k
  • 17
  • 19

You should first scale and rotate, and then translate:

        Vector3 objPos = new Vector3(0, -50, 0);
        Vector3 camPos = objPos - Vector3.One * cameraDistance;
        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation(0, -50, 0) *
                  Matrix.CreateLookAt(new Vector3(0, 0, -cameraDistance),
                                      new Vector3(0, 0camPos, 0)obsPos, Vector3.Up);

EDITED: Because camera was placed where object was not.

You should first scale and rotate, and then translate:

        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation(0, -50, 0) *
                  Matrix.CreateLookAt(new Vector3(0, 0, -cameraDistance),
                                      new Vector3(0, 0, 0), Vector3.Up);

You should first scale and rotate, and then translate:

        Vector3 objPos = new Vector3(0, -50, 0);
        Vector3 camPos = objPos - Vector3.One * cameraDistance;
        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation() *
                  Matrix.CreateLookAt(camPos, obsPos, Vector3.Up);

EDITED: Because camera was placed where object was not.

Source Link
Blau
  • 3.4k
  • 17
  • 19

You should first scale and rotate, and then translate:

        Matrix view = 
                  Matrix.CreateScale(0.01f, 0.01f, 0.01f) *
                  Matrix.CreateRotationY(MathHelper.ToRadians(cameraRotation_model)) *
                  Matrix.CreateRotationX(MathHelper.ToRadians(cameraArc)) *
                  Matrix.CreateTranslation(0, -50, 0) *
                  Matrix.CreateLookAt(new Vector3(0, 0, -cameraDistance),
                                      new Vector3(0, 0, 0), Vector3.Up);