I’m developing a very basic came In C++ with openGL and GLUT where you move the “camera” around as the player.
In short:
My camera slows down when I look at a snowman
Full explanation:
Everything was fine until I decided to finally add in an object (a giant snowman in fact), but now I’ve added it, I’m experiencing very odd behaviour.
If I look at the snowman object and attempt to move forward, It feels like I’m moving against a force, as if I was walking through mud.
Now If I face opposite the snowman, and “walk” backwards with the camera, It moves completely fine, but when I look at it… I slow down. I’ve tried different scales of the snowman, and the larger the snowman is, the further I can feel the effect.
Note though, It doesn’t appear to cause me to lag, only slow down.
Any insights would be greatly appreciated, and I will post code if needed, but currently.. I have no idea what code would be relevant!
When you say it slows down, you mean your frame rate drops? Sounds like your snowman is very polygon heavy, when it’s being rendered it causes a drop in frame rate slowing things down.
When you’re facing away from the snowman it’s being clipped, it’s not in view so the polygons comprising the model aren’t being sent all the way through the 3D pipeline.
If you don’t have back face culling turned on, you’ll probably want to do that — otherwise you probably need to simplify the model somewhat. What happens if you render a cube there instead?
Depending on what hardware you’re using, even a low poly model could cause problems if you don’t have a huge fill rate (the speed of the hardware to fill pixels in the render buffer), but given that it’s one model and that the hardware should be more than capable of filling the screen once, I’d say this is an unlikely scenario.