D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR Problem

Started by
1 comment, last by hserver 13 years, 12 months ago
hi take a look at my reflection code: Dim Mat As D3DMATRIX, mat2 As D3DMATRIX D3DDevice.GetTransform D3DTS_VIEW, Mat D3DDevice.GetTransform D3DTS_WORLD, mat2 D3DXMatrixInverse Mat, 0, Mat Mat.m41 = 0# Mat.m42 = 0# Mat.m43 = 0# Mat.m44 = 0# D3DDevice.SetTextureStageState 1, D3DTSS_COLOROP, D3DTOP_ADD D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG1, D3DTA_TEXTURE D3DDevice.SetTextureStageState 1, D3DTSS_COLORARG2, D3DTA_CURRENT D3DDevice.SetTextureStageState 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3 D3DDevice.SetTransform D3DTS_TEXTURE1, Mat D3DDevice.SetTexture 1, MeshCubeTex(FoundMeshCubeTexID) D3DDevice.SetTextureStageState 2, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE If TheMesh.AdvanceTex(PassNo).TexEffect = 4 Then D3DDevice.SetTextureStageState 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR Or 1 this Reflection works just fine when i do no scale or rotate on my mesh (D3DTS_WORLD is Identity) but when i transform my mesh it show a bad Reflection I also try . . . . D3DDevice.GetTransform D3DTS_WORLD, mat2 D3DXMatrixMultiply Mat, Mat, mat2 D3DXMatrixInverse Mat, 0, Mat Mat.m41 = 0# . . . . . it's not working too what i have to do!?
Advertisement
This Really make me mad
any idea?
here is The Answer :
I have to Normalize normals !
I hope this can help somebody else

This topic is closed to new replies.

Advertisement