Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualmrmohadnan

Posted 21 April 2013 - 06:47 AM

Hello again , I solve the rotation problem by :

            Vector3 forward = cci.Camera.WorldMatrix.Forward + new Vector3(0, -1, 0);

            if (cci.Camera.Pitch <= MathHelper.ToRadians(-40))
            {
                cci.Camera.Pitch += MathHelper.ToRadians(1);
            }
            if (cci.Camera.Pitch >= MathHelper.ToRadians(40))
            {
                cci.Camera.Pitch -= MathHelper.ToRadians(1);
            }

            Matrix translatePlayer = Matrix.CreateTranslation(cci.Camera.WorldMatrix.Translation + forward);
            Matrix scalePlayer = Matrix.CreateScale(0.05f);

            Matrix rotatePlayer = Matrix.CreateRotationX(cci.Camera.Pitch) *
                Matrix.CreateFromAxisAngle(Vector3.Up, cci.Camera.Yaw);
            staticModel.Transform = scalePlayer * rotatePlayer * translatePlayer ;    

 

but , all what I want is to prevent hands to be visible when rotating down , I try this code  and did not works good ? so any solutions or suggestion ?

 



            if (cci.Camera.Pitch <= MathHelper.ToRadians(-40))
            {
                cci.Camera.Pitch += MathHelper.ToRadians(1);
            }
            if (cci.Camera.Pitch >= MathHelper.ToRadians(40))
            {
                cci.Camera.Pitch -= MathHelper.ToRadians(1);
            } 

 

8x6lda07jcnf3na6g.jpg


#1mrmohadnan

Posted 21 April 2013 - 06:40 AM

Hello again , I solve the rotation problem by :

            Vector3 forward = cci.Camera.WorldMatrix.Forward + new Vector3(0, -1, 0);

            if (cci.Camera.Pitch <= MathHelper.ToRadians(-40))
            {
                cci.Camera.Pitch += MathHelper.ToRadians(1);
            }
            if (cci.Camera.Pitch >= MathHelper.ToRadians(40))
            {
                cci.Camera.Pitch -= MathHelper.ToRadians(1);
            }

            Matrix translatePlayer = Matrix.CreateTranslation(cci.Camera.WorldMatrix.Translation + forward);
            Matrix scalePlayer = Matrix.CreateScale(0.05f);

            Matrix rotatePlayer = Matrix.CreateRotationX(cci.Camera.Pitch) *
                Matrix.CreateFromAxisAngle(Vector3.Up, cci.Camera.Yaw);
            staticModel.Transform = scalePlayer * rotatePlayer * translatePlayer ;    

 

but , all what I want is to prevent hands to be visible when rotating down , I try this code  and did not works good ? so any solutions or suggestion ?

 




            if (cci.Camera.Pitch <= MathHelper.ToRadians(-40))
            {
                cci.Camera.Pitch += MathHelper.ToRadians(1);
            }
            if (cci.Camera.Pitch >= MathHelper.ToRadians(40))
            {
                cci.Camera.Pitch -= MathHelper.ToRadians(1);
            } 

PARTNERS