Spent the morning helping Cari with merge problems. Visual
diffing is the only way to go. Now, if only there were a way to get WinCVS and
BeyondCompare to flag conflicts properly.
I've got the initial point sprite phasor blast in. Now I've
got to tweak the parameters, like size and scale and speed. Doesn't looke
exactly like Alex's, but we can work with it.

Here's the actual render code for the point sprite. It's
kinda hacky. I hate when I have a plan and then have to wail on it because my
mind doesn't see the obvious clean solution. If anybody wants to improve on
this, please do.
struct
POINTVERTEX
{
D3DXVECTOR3 v;
D3DCOLOR color;
static const DWORD FVF;
};
const
DWORD POINTVERTEX::FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;
//
Helper function to stuff a FLOAT into a DWORD argument
inline
DWORD FtoDW( FLOAT f ) { return *((DWORD*)&f); }
//
Globals
static
LPDIRECT3DTEXTURE9 g_pPhotonTexture = NULL;
static
const ULONG MAX_STEPS = 1000;
//**************************************************************************************
void
CPhotonBlast::SetStart(D3DXVECTOR3 vStartIn)
{
vStart = vStartIn;
}
//**************************************************************************************
void
CPhotonBlast::SetEnd(D3DXVECTOR3 vEndIn)
{
// We don't need to do all this. There's gotta be a
// cleaner and easier way.
vDirection = vEndIn - vStart;
fDistToTravel = D3DXVec3Length(&vDirection);
fDistTravelled = 0.0f;
D3DXVec3Normalize(&vDirection, &vDirection);
bIsReady = TRUE;
bIsDone = FALSE;
}
//**************************************************************************************
HRESULT
CPhotonBlast::Init(LPDIRECT3DDEVICE9 pDevice)
{
HRESULT hr = S_OK;
// Clear the flags
bIsReady = FALSE;
bIsDone = FALSE;
// Load the texture (if necessary)
if(!g_pPhotonTexture)
{
hr = D3DXCreateTextureFromFile(pDevice, "gfx/phasor_blast.tga",
&g_pPhotonTexture);
}
else
{
g_pPhotonTexture->AddRef();
}
return hr;
}
//**************************************************************************************
HRESULT
CPhotonBlast::Render(LPDIRECT3DDEVICE9 pDevice)
{
// HACK:
// In the video, the phasor compresses as it hits the object
// I couldn't get that easily.
// We actually run the animation longer than necessary. Just to
// make sure the last point ends up at the destination.
// If a point is past the end point, then we just set it to the end
// point. At the end of the animation, we're drawing a whole bunch
// of unnecessary sprites at the end point.
// TODO:
// Figure out what the heck the point scalings do and how to
// modify them to get our desired results. I could use post
// transformed points to adjust the scales manually for each
// point so that we get the "start small, end big" effect.
// Also, the point scales are in eye coordinates. The further
// I zoom, the larger they get. Gotta adjust the scales for that.
HRESULT hr;
if(!bIsReady)
return E_FAIL;
D3DXMATRIX matIdent;
D3DXMatrixIdentity(&matIdent);
pDevice->SetTransform(D3DTS_WORLD, &matIdent);
// Set the render states for using point sprites
pDevice->SetRenderState( D3DRS_ZENABLE, FALSE );
pDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE );
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );
pDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, TRUE );
pDevice->SetRenderState( D3DRS_POINTSCALEENABLE, TRUE );
pDevice->SetRenderState( D3DRS_POINTSIZE, FtoDW(20.0f) );
pDevice->SetRenderState( D3DRS_POINTSIZE_MIN, FtoDW(1.00f) );
pDevice->SetRenderState( D3DRS_POINTSCALE_A, FtoDW(1.00f) );
pDevice->SetRenderState( D3DRS_POINTSCALE_B, FtoDW(1.00f) );
pDevice->SetRenderState( D3DRS_POINTSCALE_C, FtoDW(1.00f) );
// Set up the vertex buffer to be rendered
pDevice->SetFVF( POINTVERTEX::FVF );
pDevice->SetTexture(0, g_pPhotonTexture);
// Load the vertices into an array
POINTVERTEX pts[MAX_STEPS];
ULONG ulCurrIdx = 0;
D3DXCOLOR colWhite(1.0f, 1.0f, 1.0f, 1.0f);
// Current position is always at idx 0.
pts[0].v = vStart + vDirection * fDistTravelled;
pts[0].color = colWhite;
// HACK:
if(fDistTravelled > fDistToTravel)
pts[0].v = vEnd;
// Create the trail of points leading from the start.
for(int i = 1; i < ulNumSteps; i++)
{
pts[i].v = pts[i-1].v + vDirection * -0.2f;
pts[i].color = colWhite;
// HACK:
D3DXVECTOR3 v = pts[i].v - vStart;
if(D3DXVec3Length(&v) > fDistToTravel)
pts[i].v = vEnd;
}
// HACK:
if(pts[ulNumSteps-1].v == vEnd)
bIsDone = TRUE;
// Draw the points
hr = pDevice->DrawPrimitiveUP(D3DPT_POINTLIST,
ulNumSteps,
(PVOID)pts,
sizeof(POINTVERTEX));
//
Reset render states
pDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pDevice->SetRenderState( D3DRS_POINTSPRITEENABLE, FALSE );
pDevice->SetRenderState( D3DRS_POINTSCALEENABLE, FALSE );
pDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE );
return hr;
}
//**************************************************************************************
HRESULT
CPhotonBlast::Update(FLOAT fElapsedSecIn)
{
if(!bIsReady)
return E_FAIL;
fDistTravelled += fVelocity * fElapsedSecIn;
return S_OK;
}
Got into a huge discussion with the project folks about how
to improve the graphic quality of the ships. So now, Cari and I are revamping
all the scene lighting. It was a real mess before. Alex is going to give us
high poly ships that can do diffuse lighting properly. It's going to be sweet
(I hope).

After a few minutes working with Cari, we completely
revamped the lighting. It really wasn't that hard. Now all we have to do is
tweak our material and lighting parameters. Now for self shadowing objects
(right!).

In between all that stuff, I managed to get with Scott to
discuss some polmachine stuff. We're going to get that looking cool too 
Check out https://www.stardock.com/products/polmachine.
Anyways, got one thing done on my list and added some more.
Go figure! That's life.