Jump to content
  • Advertisement
Sign in to follow this  
meherzad

how to get a value at runtime

This topic is 3363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that. plus i have an xyz plane value .how will i convert it to an integer value.

Share this post


Link to post
Share on other sites
Advertisement
If you want the position of the player, you need to keep up with that in your code... there is no intrinsic "player position" in XNA.

I'm not sure what you are talking, regarding the integer/plane question.

Share this post


Link to post
Share on other sites
i m also asking about how i will use the function which will read these values.

the syntax in C sharp.

Share this post


Link to post
Share on other sites
and the second question is

that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.

Share this post


Link to post
Share on other sites
Quote:
Original post by meherzad
and the second question is that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.
What does comparing a plane with an integer mean?? When is an integer greater than a plane? Is an apple less than an orange?

Share this post


Link to post
Share on other sites

bool Compare(Plane p, int i)
{
throw new Exception("WTF is this shit?");
}


That should do what you want.

Share this post


Link to post
Share on other sites
Quote:
Original post by meherzad
I am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that.


This isn't something you read, this is something you set.

Quote:

i have an xyz plane value .how will i convert it to an integer value.


I'm more curious about what problem you believe this is a solution to - maybe we can find a method that makes sense.

Share this post


Link to post
Share on other sites
Quote:
Original post by meherzad
and the second question is

that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.


Planes cannot be "ordered", because they can (and in fact, almost always do) intersect (meaning that you can't meaningfully say one is "less than" the other). Why do you want to do this comparison? What do you think it will help you do?

Share this post


Link to post
Share on other sites
My guess is that he wants to calculate the closest/perpendicular distance to the plane from the player's position. (So he can make test like if(dist < 0) { /*position is under ground */ }.

And I guess he means scalar and not integer..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!