Razor89
07-23-2004, 10:28 PM
Could any of you tell me how to fix this?
Its not drawing the textured quad correctly. I get a wierd shape and it
doesnt display the texture correctly.
Here is my vertexs's initiation code:
Quad(0) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 0, 0) '0, 0
Quad(1) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 1, 0) '1, 0
Quad(2) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 0, 1) '0, 1
Quad(3) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 1, 1) '0, 0
Here is my drawing code:
Private Sub DrawTile(ByVal X As Integer, ByVal Y As Integer)
With Quad(0)
.X = (X * 32)
.Y = (Y * 32)
.Tu = 0
.Tv = 0
End With
With Quad(1)
.X = ((X * 32) + 32)
.Y = (Y * 32)
.Tu = 1
.Tv = 0
End With
With Quad(2)
.X = ((X * 32) + 32)
.Y = ((Y * 32) + 32)
.Tu = 0
.Tv = 1
End With
With Quad(3)
.X = (X * 32)
.Y = ((Y * 32) + 32)
.Tu = 1
.Tv = 1
End With
cMolecule.D3DDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, Quad)
End Sub
Thanks for your help.
Here is what it looks like:
Its not drawing the textured quad correctly. I get a wierd shape and it
doesnt display the texture correctly.
Here is my vertexs's initiation code:
Quad(0) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 0, 0) '0, 0
Quad(1) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 1, 0) '1, 0
Quad(2) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 0, 1) '0, 1
Quad(3) = New Direct3D.CustomVertex.TransformedColoredTextured(0, 0, 0, 0, Color.White.ToArgb, 1, 1) '0, 0
Here is my drawing code:
Private Sub DrawTile(ByVal X As Integer, ByVal Y As Integer)
With Quad(0)
.X = (X * 32)
.Y = (Y * 32)
.Tu = 0
.Tv = 0
End With
With Quad(1)
.X = ((X * 32) + 32)
.Y = (Y * 32)
.Tu = 1
.Tv = 0
End With
With Quad(2)
.X = ((X * 32) + 32)
.Y = ((Y * 32) + 32)
.Tu = 0
.Tv = 1
End With
With Quad(3)
.X = (X * 32)
.Y = ((Y * 32) + 32)
.Tu = 1
.Tv = 1
End With
cMolecule.D3DDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, Quad)
End Sub
Thanks for your help.
Here is what it looks like: