Jump to content

  • Log In with Google      Sign In   
  • Create Account


Stragen

Member Since 18 Jun 2012
Offline Last Active Jul 24 2014 05:21 AM
-----

Posts I've Made

In Topic: Container Selection

21 December 2013 - 09:38 PM

To answer the question around the need to be indexed, while also look up capable; the resource files that i'm using have multiple ways of referencing the same piece of data...

 

For example: one part of the file might refer to an element by its ID name, with another part referring to its index within the container, the format isnt mine, so i've got no real control over that.

 

this being said, a vector of pointers might be the trick, if the string name is used, use the map to find the reference, if an integer index is used, use the vector of pointers to the map.


In Topic: C++ Breakout: collision detection(and which side collided)

18 November 2013 - 04:22 AM

What you've done in your code is what i like to call 'Block' collision detection, where you are testing for a case where Object A is within Object B.

 

This is fine if you have unit, integer, velocities and tracking that never exceeds 1, as soon as you introduce larger values it is possible for ghosting/clipping to occur. (Object A passes through Object B and appears on the other side) In this case you can end up within the object you're testing for which will cause your if statements to freak out (and the first in the order will be the reaction that applies).

 

To solve this unfortunately(fortunately for some) requires the use of some math, specifically the kind of stuff you could do in high school..

 

"I have a train that is traveling east at 25km/h, and a train traveling west at 10km/h, they are 40km apart, when will they collide?"

 

Determining the side at which its coming from requires calculating the direction of movement or a vector (if the ball is moving up, and the object is above the model, then it cant hit from the top can it?) and determining the reaction is a case of newtons third law (for every action, an equal and opposite reaction) which will change the vector's angle (flipping either X velocity or y velocity)


In Topic: How to compute the bounding volume for an animated (skinned) mesh ?

18 November 2013 - 04:08 AM

 

If you are really needing to create an AABB, you will have to generate it based on the largest X,Y,Z value of the post scaled, translated, and rotated model. Its more important to do it against the post rotated model as you need the X,Y,Z based on where it lies after rotation, the result could then be scaled and translated. This will still need to be done each animation step as this is going to change where the BB is going to lie based on the location of the verticies changing each step.

Animation of a mesh is an object space transformation, just as AABB is a object space axis aligned box. Further than object space transformations apply to AABB as well -with the same transformation result. The OP wants to have objects space box that encapsulates object space geometry every animation frame accurately.

 

The definition of the animation steps is just a case of being specific, you could calculate the AABB once, for example at model loading, and you could say thats it. Sure you have a BB, but it wont represent the simplified volume taken up by the model as the arms and legs of the model flail around outside of the initial BB volume.


In Topic: C# - Need help with choosing a way to solve a ridiculously easy 2D graphics task

17 November 2013 - 01:52 AM

For OGL i know the NEHE tutorials cover the display of a piece of text, though these are more C++ related... but the translation shouldn't be too difficult.

 

http://nehe.gamedev.net/tutorial/outline_fonts/15004/

 

I agree with Nik that you cant guarantee the delivery every 1/60th of a second, but i think you could get pretty darn close.


In Topic: How to compute the bounding volume for an animated (skinned) mesh ?

13 November 2013 - 03:18 AM

If you are really needing to create an AABB, you will have to generate it based on the largest X,Y,Z value of the post scaled, translated, and rotated model. Its more important to do it against the post rotated model as you need the X,Y,Z based on where it lies after rotation, the result could then be scaled and translated. This will still need to be done each animation step as this is going to change where the BB is going to lie based on the location of the verticies changing each step.

 

You probably shouldn't bother with the generation of the maxes prior to transforming the model if you're not concerned with the OBB, so once you've transformed it calculate based on the same process that you did when calculating the 'OBB' the first time.

 

If you calculate the model maxes prior to the translation/scale/rotate you will get the maxes based on the model only in model space, and applying the same transformation will result in a OBB in world space.

 

Just to consider, below is an example of where an AABB is going to give you something that doesnt look right for the volume taken up by an object.

 

Attached File  boundingboxexample2.png   1.33KB   3 downloads

 

The blue boxes are the same size, the AABB box has been cast in red on the box on the right.

The OBB for the blue box on the right will be the same space as the blue box.

 

If you go to investigate collision detection later down the track, AABB's are great for quick culling for proximity, OBB's create better accuracy for your final pass.


PARTNERS