1 #include "..\include\raMain.h" 5 float radius,
bool bProcedural,
bool bLighted,
raMaterial* pMaterial) :
raEntity(dx, pMaterial? pMaterial
8 bLighted?
"RenderWithTextureAmbient":
"RenderWithTexture",
9 "raGrafik\\Skydome1.jpg"))))
12 m_width = (float)width;
13 m_height = (float)height;
16 m_nIndices = 6 * ((DWORD)m_width - 1) * ((DWORD)m_height - 1);
28 for (
int y = 0; y < m_height; y++)
33 theta = 0.5f *
PI * (0.5f / ((float)m_height - 1));
35 theta = 0.5f *
PI * (y / ((float)m_height - 1));
36 float rsintheta = m_r * sin(theta);
37 float rcostheta = m_r * cos(theta);
38 for (
int x = 0; x < m_width; x++)
40 float phi = 2 *
PI * x / ((float)m_width - 1);
59 for(
int y = 0; y < m_height - 1; y++)
61 for(
int x = 0; x < m_width - 1; x++)
83 float zf = pProj.
m43/ (1 - pProj.
m33) ;
85 float scale = 0.04f * zf;
90 D3DXMatrixInverse((D3DXMATRIX*)&mInvView, NULL, (D3DXMATRIX*)&pView);
92 worldTmp.
m41 = mInvView.m41;
93 worldTmp.
m42 = mInvView.m42 - scale * 0.2f;
94 worldTmp.
m43 = mInvView.m43;
96 raMatrix mWorldView, mWorldViewProjection;
97 mWorldView = worldTmp * pView;
98 mWorldViewProjection = mWorldView * pProj;
104 mWorldViewProjection);
virtual void SetupVertices()
virtual void SetupPerFrame(const raLight *Light, const raMatrix *pView=NULL, const raMatrix *pProj=NULL)
VERTEXPOSITIONTEXTURED * m_pVertices
RAPI raMatrix raMatrixScaling(const raVector3 &v)
SDKMESH_SUBSET * m_pSubsets
raSkyDome(raSmartPointer< raDirectX > dx, int width, int height, float radius=1.0f, bool bProcedural=false, bool bLighted=false, raMaterial *pMaterial=NULL)
raMaterial ** m_pMaterials
virtual void SetupPerObject(const raMatrix &mWorld, const raMatrix &mWorldView, const raMatrix &mWorldViewProjection)
virtual void SetupIndices()
virtual void SetupEffectVariables(const raMatrix &pView, const raMatrix &pProj, const raLight *Light)