Results 1 to 3 of 3

Thread: how can i recognize objects by coordinates?

  1. #1
    Newbie Newbie
    Join Date
    Jul 2014

    how can i recognize objects by coordinates?

    hi all
    I have a house and some dynamic objects in i want to stop camera going through wall and get into house.i want to write a function calculate that is there any wall or not in that coordinates, if there is stop the camera .is there any function?a function that if there is not something return null.

  2. #2
    Member Newbie
    Join Date
    Mar 2013

    that what you want to do is not a really good idea, because what will be the result if you
    check for the x coordinate 16.000001 and the 'wall' is on the x coordinate 16.0?

    Those 'walls', triangles, quads, triangle-strips, ... in OpenGL are infinite thin! I would really
    just use a phyiscs library like bullet physics which provides these features in a fast and reliable
    way. You'll just feed all your vertices to the physics library and it will check for you if a
    collision happened or not and how the objects should behave after that collision.

    Another, but more costly way to deal with it, would be bounding volumes. You will check
    if the bounding volume from the camera intersects with the bounding volume from the
    wall. Physics libraries support those features too, because they are based on it, but
    if you want to implement it on your own, bounding volumes would be the right choice.

    - Daniel

  3. #3
    Senior Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Innsbruck, Austria
    Sounds like you want some sort of collision dedection.

    If you only want your camera to collide with world objects, you can do that by casting rays into you scene
    representation and check for collisions with bounding volumes of your objects.

    If you want your dynamic objects to move and collide with things, the whole thing might get a little more
    involved and you would need something more sophisticated.

    A typicall approach is to build a tree structure (something like bounding sphere tree) to do a rough estimation
    of objects that might collide and then do a finer grained collission dedection on the resulting objects.

    If at some point you were to decide that dynamics simulation is a cool thing to have, the easiest approach
    would be to go ahead and use an existing "physics engine".

    There are countless free software physics engines out there that implement collision dedection as well as
    rigid body dynamics simulation.

    To name a few:

Similar Threads

  1. [Help] Recognize face application
    By ahs3ng in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-14-2008, 08:58 PM
  2. Recognize x,y,z
    By krzbor in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-15-2004, 01:12 AM
  3. Does anyone recognize this?
    By Pentagram in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 06-04-2002, 08:09 PM
  4. Collision detection & locating objects coordinates
    By sdom100 in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-12-2002, 02:57 AM
  5. Positioning 3d-objects with 2d-coordinates
    By DJ in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 07-08-2001, 02:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean