|
Public Sub Render3D()
Device.Clear 1, ClearRec(), _
D3DCLEAR_TARGET Or D3DCLEAR_ZBUFFER, _
DX7.CreateColorRGBA(0.04, 0.04, 0.07, 1), 1, 0
Device.BeginScene
Call Device.SetTexture(0, texSky)
Call Device.DrawPrimitive(D3DPT_TRIANGLELIST, D3DFVF_LVERTEX, _
vxSky(0), UBound(vxSky()) + 1, D3DDP_WAIT)
Call Device.SetTexture(0, texHorizont)
Call Device.DrawPrimitive(D3DPT_TRIANGLELIST, D3DFVF_LVERTEX, _
vxHorizont(0), UBound(vxHorizont()) + 1, D3DDP_WAIT)
Call Device.SetTexture(0, texFloor)
Call Device.DrawPrimitive(D3DPT_TRIANGLELIST, D3DFVF_LVERTEX, _
vxBoden(0), UBound(vxBoden()) + 1, D3DDP_WAIT)
Call Device.SetTexture(0, texWindow)
'ColorKey einschalten
If bolColorKey Then
Call Device.SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, True)
End If
'Textur beidseitig rendern
Call Device.SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)
Call Device.DrawPrimitive(D3DPT_TRIANGLELIST, D3DFVF_LVERTEX, _
vxWand(0), UBound(vxWand()) + 1, D3DDP_WAIT)
'Textur nur auf einer Seite rendern
Call Device.SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_CCW)
'ColorKey ausschalten
If bolColorKey Then
Call Device.SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, False)
End If
Device.EndScene
End Sub
|
|