Results 1 to 2 of 2

Thread: ortho projections in games

  1. #1
    Member Contributor
    Join Date
    Jan 2002
    Posts
    96

    ortho projections in games

    I need some help. My breakout clone now has some collision detection function but I dont understand how it all fits together.

    I have an ortho projection( -100 to 100 in all directions ) and my paddle is specified in a class in a different file. How does the vertex data get transferred to the ortho projection? The top polygon of the paddle is defined like this:

    Code :
    		//top face coordinates
    		top[ 0 ].setValues( -width/2.0, 2.0, -2.0 );
    		top[ 1 ].setValues( -width/2.0, 2.0, 2.0 );
    		top[ 2 ].setValues( width/2.0, 2.0, 2.0 );
    		top[ 3 ].setValues( width/2.0, 2.0, -2.0 );
    		flat[ 2 ].setValues( top, QUAD_POINTS );
    However when I try testing for collisions, they only occur around the origin as if the polygon was defined there, when it is being drawn at the bottom of the screen. I am lost as to how to rectify this situation

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    442

    Re: ortho projections in games

    I assume you are moving your paddle about to a given position? So although you seem to have defined it around the origin, it will actually be at position x, y.

    Your collision detection therefore needs to add the x, y position of the paddle to all 4 co-ordinates ( which define the paddle around the origin) before it does its test).

Similar Threads

  1. Replies: 2
    Last Post: 06-06-2015, 07:35 AM
  2. projections
    By mikethebike in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-11-2012, 06:10 PM
  3. Having problems with projections
    By profbalse in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 09-15-2003, 02:52 PM
  4. projections
    By karteek in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-01-2003, 01:47 PM
  5. Mixed projections
    By martinjy in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-21-2001, 12:31 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