View Full Version : Sensing an objects(Quads/Triangle) Positioning
08-12-2011, 04:03 PM
I am creating a 3D game in Java using Lwjgl and i wanted to know if so, how can sense if a Quad/Triangle is in front of you or beside you. I would like to know this because i need to make the person stop moving forward when there is an object in front of them. Please help!?!?!?!?!?
08-12-2011, 04:49 PM
You don't. You're thinking way too much from a visual perspective, and not enough of a game development perspective.
You see a polygon near another polygon. That's not how your game should be thinking. It should be thinking in terms of the location of entities. Where are your game objects? Not the meshes, but the things that drive the meshes.
Collision between objects in a game is not governed by what you see. It is not covered by what gets drawn (and OpenGL only deals with drawing). It is governed by your collision detection system.
08-12-2011, 05:31 PM
So your saying i have to make an aray of all the object positions and call it every time i move.
08-12-2011, 06:30 PM
No, I'm saying that you should already have an array of all object positions. How else would you know where anything is?
A game is not merely a rendering application. You need to keep your game state separate from your rendering state.
08-13-2011, 05:57 AM
lol ummm yeah sure i do! XD dont worry i was gonna do that anyway thanks for the help cause i would of spent like mounths trying to find that out.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.