Advertisement

Possible Use of Octree, Please

Started by September 01, 2018 04:20 PM
2 comments, last by slayemin 6 years, 2 months ago

I was thinking for a project to make a simple golf game.  The idea would be to hit the ball with input settings and then follow the ball with a camera in the air until it landed and then watch it roll on the mesh.  Of course, when there are too many polygons (triangles) it would slow down.  So I want to do some research but I want to do it quickly.  I am thinking of holding the .obj data in some sort of data structure and perhaps using binary space partitioning.  An octree seems to be a good guess of where to start, however, I am not certain.  Can anyone inform me of what I could study that would be both worthwhile and easy?  I think this would be a marvelous project to work on, however if it is to difficult I will need to work on something else.

 

Thank you,

Josheir

One option would be to use an existing physics engine for the physics part of things. If you want to do it yourself though, an octree might work, but have you considered a regular grid? A golf course and its contents occupy a more or less arbitrary area with respect to two of the three axes, but is fairly constrained along the third (vertical) axis. As such, it seems a grid representation might be a viable option. (Of course it depends on the details, such as how your environment is represented, whether it's a strict heightmap or arbitrary mesh, whether there are other interactive objects like trees, and so on.)

Advertisement

I think what you’re really looking for is an LOD system for terrain which would apply a bit of a mesh simplification system based on screen space. An octree could be used to do that, among other options/alternatives. If you’re building your own game engine, be prepared to spend weeks to a month getting it right. If you’re using an existing engine like Unity or UE4, it should already do this for you out of the box and cost you nothing.

This topic is closed to new replies.

Advertisement