Razor89
05-13-2004, 08:37 PM
I can't seem to figure out how to wrap a texture inside the cylinder I am
making. Could somebody help me?
On Error Resume Next
Set Geom = New m3dGeometry
Dim Angle As Long, I As Long
With Geom
.SetParent mCore
For Angle = 0 To 360
I = I + 1
.AddVertex Cos(Radian(Angle) * Radius), 2, Sin(Radian(Angle) * Radius), Helper.m3dRGBA(255, 255, 255, 255), 0, Angle / 360, 0
.AddVertex Cos(Radian(Angle) * Radius), -2, Sin(Radian(Angle) * Radius), Helper.m3dRGBA(255, 225, 255, 255), 0, Angle / 360, 1
Next Angle
For I = 0 To .VertexCount
.AddIndice I
.AddIndice I + 1
.AddIndice I + 2
Next
.CompileVertex
.CompileIndice
.SetCompiledCurrent
.SetIndexCompiledCurrent
vCount = Geom.IndexCount / 6
End With
AddVertex parameters:
Function AddVertex(ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal Color As Long, ByVal Specular As Long, ByVal U As Single, ByVal V As Single)
Thanks!
making. Could somebody help me?
On Error Resume Next
Set Geom = New m3dGeometry
Dim Angle As Long, I As Long
With Geom
.SetParent mCore
For Angle = 0 To 360
I = I + 1
.AddVertex Cos(Radian(Angle) * Radius), 2, Sin(Radian(Angle) * Radius), Helper.m3dRGBA(255, 255, 255, 255), 0, Angle / 360, 0
.AddVertex Cos(Radian(Angle) * Radius), -2, Sin(Radian(Angle) * Radius), Helper.m3dRGBA(255, 225, 255, 255), 0, Angle / 360, 1
Next Angle
For I = 0 To .VertexCount
.AddIndice I
.AddIndice I + 1
.AddIndice I + 2
Next
.CompileVertex
.CompileIndice
.SetCompiledCurrent
.SetIndexCompiledCurrent
vCount = Geom.IndexCount / 6
End With
AddVertex parameters:
Function AddVertex(ByVal X As Single, ByVal Y As Single, ByVal Z As Single, ByVal Color As Long, ByVal Specular As Long, ByVal U As Single, ByVal V As Single)
Thanks!