Jump to content
  • Advertisement
Josheir

C++ Perspective with Golf Putting Game

Recommended Posts

I am trying to make a golf putting game where the player rotates around a point where the ball is in a world of triangles.  I was going to use a grid to keep track of all the data and possibly keep the angle of the face the same for each of the quads made up of each of the (two) triangles.  The problem I did not anticipate is when the player rotates around the point of the ball to putt it, the squares that make up the world are not orthogonal, they are displayed with angular perspective.

I am wondering how I would work having more than four 45 degree angles to putt.  I would also like the ball to stop at various points in the quadrant where it could be putt again.

I am hoping for some good feedback about this idea.

Thank you,

Josheir

Share this post


Link to post
Share on other sites
Advertisement
2 hours ago, Josheir said:

the squares that make up the world are not orthogonal, they are displayed with angular perspective.

They can be both. Don't worry about how things are displayed while working in world space. You can imagine your world space as a perfect 3D arena and never take into account any subsequent spaces as affecting game play. Don't even imagine the game as being in camera space. The camera is best thought of as a game object and not a position at the origin; you can have multiple cameras/POVs even with an FPS. Just be aware of where the game camera(s) is in world space and let the view matrix do it's thing.

One more point I want to make that is not directly related to your post that might help you sometime. There is no OpenGL camera at the origin. It's a big lie. The game camera is moved to the origin to make further calculations less complex. And even that is a lie, the view matrix doesn't move the camera, it moves everything else.

Edited by fleabay

Share this post


Link to post
Share on other sites

Don't use objects that look good from specific view angles only. Since you need putting from arbitrary directions, you know that you need to display the golf course from all directions without bad cases.

On the other hand, there are other constraints: you can choose the position in the viewport of the hole (presumably in the middle, left to right, and at a fixed or slightly varying height) and the horizon height (usually matching a typical person's height). Both constraints could allow you to apply simplifying assumptions to your assets.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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!