Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8579621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:38:51+00:00 2026-06-11T20:38:51+00:00

I have written a program to record the joint values of the Skeleton .

  • 0

I have written a program to record the joint values of the Skeleton . . basically RightHand.joint to get the X, Y , Z coordinates from the Sensor, now i want to use these values to animate my 3D model .. somehow i have gotten the formula to convert the x,y values to the real world projection but don’t understand how to do that with the Z coordinate.. Also i dont understand why we need to do the following

 int x = (int) Math.Floor(((float.Parse(temp[0]) * 0.5f) + 0.5f) * maxWidth);
 int y = (int) Math.Floor(((float.Parse(temp[1]) * -0.5f) + 0.5f) * maxHeight);

Isnt it sufficient to just multiply the x and y values by the screen width & height instead of doing *0.5f (+0.5f) . . If someone could explain it would be very helpful and also how to get the Z coordinates?

Here is the code:

      protected override void Update(GameTime gameTime)
        {
             //// TODO: Add your update logic here
            using (StreamReader r = new StreamReader(f))
            {
                string line;
                Viewport view = graphics.GraphicsDevice.Viewport;
                int maxWidth = view.Width;
                int maxHeight = view.Height;

                while ((line = r.ReadLine()) != null)
                {
                    string[] temp = line.Split(',');

      int x = (int)Math.Floor(((float.Parse(temp[0]) * 0.5f) + 0.5f) * maxWidth);
      int y = (int)Math.Floor(((float.Parse(temp[1]) * -0.5f) + 0.5f) * maxHeight);

       //Wrong Z - value Cal (Testing)
       int z = (int)Math.Floor(((float.Parse(temp[2])* 0.5) + 0.5f) * maxHeight);

                 motion_z.Add(new Point3D(x, y, z));

             }
         }

             ModelPosition.X = (float)(motion_z[i].X);
             ModelPosition.Y = (float)(motion_z[i].Y);
             ModelPosition.Z = (float)(motion_z[i].Z);

             i++;
          base.Update(gameTime);
       }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:38:52+00:00Added an answer on June 11, 2026 at 8:38 pm
    int x = (int)Math.Floor(((float.Parse(temp[0]) * 0.5f) + 0.5f) * maxWidth);
    int y = (int)Math.Floor(((float.Parse(temp[1]) * -0.5f) + 0.5f) * maxHeight);
    int z = (int)Math.Floor(((float.Parse(temp[2])/4)* 20000));
    
     motion_z.Add(new Point3D(x, y, z));
    

    The 20000 is the value of depth distance you are defining in the vector3 camera position and it should animate properly

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a little program that deletes a record from the database using
I have written php program and uploaded on server. I want run this program
I have written a program that uses qhttp to get a webpage. This works
I have written a program in visual basic and want it to display the
I have written a program which uses CardLayout. I want it to show a
I have written a code to delete a record in a MySQL database from
I have written a program which reads input from csv file and its working
I have written program in android for downloading from web server I have Used
i have written a program and it works with 3D coordinates (i.e. x,y,z). input
I have written a program in VB6. When I compile it and send it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.