Hi guys, I am currently trying to implement some tree billboards to my scene and am stuck at the moment.
Currently I am trying to employ the method used in the book - Introduction to 3D game programming with directx 10 , Frank D. Luna and he has made it so that the billboards always face the camera. Which I don't want to be honest as when the camera moves the trees look fake.
So how would I do this?
here is my draw code:
void TreeSprites::draw(const Light& L, const D3DXVECTOR3& eyePosW, const D3DXMATRIX& viewProj)
{
mfxEyePosVar->SetRawValue((void*)&eyePosW, 0, sizeof(D3DXVECTOR3));
mfxLightVar->SetRawValue((void*)&L, 0, sizeof(Light));
mfxViewProjVar->SetMatrix((float*)&viewProj);
mfxTreeMapArrayVar->SetResource(mTreeMapArrayRV);
md3dDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST);
md3dDevice->IASetInputLayout(mVertexLayout);
D3D10_TECHNIQUE_DESC techDesc;
mTech->GetDesc( &techDesc );
for(UINT i = 0; i < techDesc.Passes; ++i)
{
ID3D10EffectPass* pass = mTech->GetPassByIndex(i);
pass->Apply(0);
UINT stride = sizeof(TreeVertex);
UINT offset = 0;
md3dDevice->IASetVertexBuffers(0, 1, &mVB, &stride, &offset);
md3dDevice->Draw(mNumTrees, 0);
}
}
and here is my draw call:
mTrees.draw(mParallelLight, mEyePos, mView*mProj);
Any help on the matter would be great and if possible could you please explain the matter so that I don't have to ask such a menial question next time round :P
Thanks a lot! :D