Jump to content

  • Log In with Google      Sign In   
  • Create Account

Steve_Segreto

Member Since 26 Jun 2009
Offline Last Active Dec 14 2014 02:27 PM

Posts I've Made

In Topic: Paul Nettle's memory tracker mmgr and C++11

13 April 2014 - 09:14 PM

Most of Paul Nettle's publicly released code comes from the late-90s, early 2000s IIRC. I guess you could say that particular piece of code didn't age very well, but at the same time you got it for free and didn't pay anything for using it, so I think on balance you've come out ahead.


In Topic: Camera walk upon stairs

07 February 2014 - 07:34 AM

Have a read through this, http://www.peroxide.dk/papers/collision/collision.pdf

 

Also rather than submitting your rendered geometry for collision detection/resolution, consider having a simplified mesh geometry for collisions, and your staircase would have a collision model that was just a ramp.


In Topic: Animation Retargeting

31 January 2014 - 10:40 PM

Lorenzo is right, but if you don't have the time or energy to read the latest research papers (which use a highly stylized math form), one thing you could try is affinitize the guest skeleton's bones to the host skeleton by transforming both skeletons into the same local space and then connecting guest bones to nearest neighbor skeleton bones using something like:

 

for (DWORD i = 0; i < pSkin->m_numOffsetMatrices; i++)
{
   D3DXVECTOR3 SkinPos( 0.0f, 0.0f, 0.0f );
   D3DXMATRIX boneOffsetToRoot;
   D3DXMatrixInverse( &boneOffsetToRoot, NULL, &pSkin->m_boneOffsetTransforms[ i ] );
   D3DXVec3TransformCoord( &SkinPos, &SkinPos, &boneOffsetToRoot );
   float bestDist = INFINITY;
   for (DWORD j = 0; j < pSkeleton->m_numFrames; j++)
   {
      D3DXVECTOR3 BindPos( 0.0f, 0.0f, 0.0f );
      D3DXVec3TransformCoord(
                           &BindPos,
                           &BindPos,
                           &pSkeleton->m_matrixFrames[ j ].
                           m_skeletalRootSpace );
      float dist = D3DXVec3Length( &D3DXVECTOR3( SkinPos - BindPos ) );
      if (dist < bestDist)
      {
         bestDist = dist;
         pSkin->m_boneIndex[ i ] = j;
      }
   }
}


In Topic: Acceleration based movement and snapping on a grid based map

31 January 2014 - 10:23 PM

Here is how to snap to a grid. (x,z) range in the larger local space and can be adjusted according to your velocity scheme above.

 

void
LocalToGrid( float x, float z, int &row, int &col )
{
// Transform from local space to "grid" space.
float c = (x) / TILE_SIZE_X;
float d = (z) / TILE_SIZE_Z;
// Get the row and column we are in.
row = (int)floorf(d);
col = (int)floorf(c);
}


In Topic: Self-Taught Programmer Stuck in a Rut

30 December 2013 - 09:52 PM

Ok so it's been 10 days and not two weeks but I think it's ready to show smile.png

I wrote a crappy engine (doing that went waaaaaaay past my comfort zone - it was awesome) and in like no time at all I wrote this little Procedural City thing.

 

http://imgur.com/tvWyU1F,XDVZjZ5#1

 

There's a current screenshot of it, I have a lot of plans for it, and it's gonna be doing some cool things soon.

 

Anyway it had been about a year and a half since I programmed something like that, so I figure that's why I felt so stuck in a rut.

 

Thanks for the advice guys!

Great work! Have a look at this great blog. http://www.shamusyoung.com/twentysidedtale/?p=2940


PARTNERS