Wrap texture inside cylinder

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!

er32
05-19-2004, 01:41 PM
Use texture coordinates for per face
do not use one texture coordinate for all faces of cylinder
per face is (0,0) (1,0) (0,1) (1,1)
Ok

Razor89
05-19-2004, 02:06 PM
Finally somebody awnsers!
How would I go about doing that?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum