亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? blockform.vb

?? Windows mobile 6 Direct3D 編程例子
?? VB
字號:
Imports System.Drawing
Imports Microsoft.WindowsMobile.DirectX
Imports Microsoft.WindowsMobile.DirectX.Direct3D

Module ProgramMain
    Sub Main()
        Dim frm As BlockForm = New BlockForm

        ' Initialize Direct3D
        If Not frm.Init() Then
            MessageBox.Show("Could not initialize Direct3D")
            Return
        End If

        System.Windows.Forms.Application.Run(frm)
    End Sub
End Module

Public Class BlockForm

    Public Class ImageBackground
        ''' <summary>
        ''' Texture to be drawn with. Passed into the constructor.
        ''' </summary>
        Public BackgroundTexture As Texture

        ''' <summary>
        ''' This defines the shape of our background image and the texture of the vertices.
        ''' </summary>
        Public Vertices As CustomVertex.PositionNormalTextured()

        ''' <summary>
        ''' Vertex buffer which is used by the display hardware 
        ''' recieve details of what we want to draw.
        ''' </summary>
        Public VertBuffer As VertexBuffer = Nothing

        Public Sub New(ByVal device As Device, ByVal textureStream As System.IO.Stream, ByVal sz As Single, ByVal z As Single)
            BackgroundTexture = TextureLoader.FromStream(device, textureStream)
            Vertices = New CustomVertex.PositionNormalTextured(5) {}
            Vertices(0) = New CustomVertex.PositionNormalTextured(-sz, -sz, z, 0.0F, 0.0F, -1.0F, 0.0F, 1.0F)
            Vertices(1) = New CustomVertex.PositionNormalTextured(-sz, sz, z, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F)
            Vertices(2) = New CustomVertex.PositionNormalTextured(sz, -sz, z, 0.0F, 0.0F, -1.0F, 1.0F, 1.0F)
            Vertices(3) = New CustomVertex.PositionNormalTextured(sz, -sz, z, 0.0F, 0.0F, -1.0F, 1.0F, 1.0F)
            Vertices(4) = New CustomVertex.PositionNormalTextured(-sz, sz, z, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F)
            Vertices(5) = New CustomVertex.PositionNormalTextured(sz, sz, z, 0.0F, 0.0F, -1.0F, 1.0F, 0.0F)

            VertBuffer = New VertexBuffer(GetType(CustomVertex.PositionNormalTextured), Vertices.Length, device, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, Pool.SystemMemory)
        End Sub

        ''' <summary>
        ''' Draw the textured image.
        ''' </summary>
        ''' <param name="device">target device to draw on</param>
        Public Sub Draw(ByVal device As Device)

            ' Set the data in the vertex buffer to our triangles
            VertBuffer.SetData(Vertices, 0, LockFlags.None)

            ' clear off any existing transformations
            device.Transform.World = Matrix.Identity

            ' Point the device at our vertex buffer
            device.SetStreamSource(0, VertBuffer, 0)

            ' Assign the texture to the device.
            device.SetTexture(0, BackgroundTexture)

            ' Ask the device to draw the contents of the buffer
            device.DrawPrimitives(PrimitiveType.TriangleList, 0, 2)

            ' Stop using this texture
            device.SetTexture(0, Nothing)
        End Sub
    End Class

    Private iImageBackground As ImageBackground

    ' <summary>
    ' Currently executing assembly. Cached because it is used
    ' to load a lot of resources. 
    ' </summary>
    ReadOnly assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly

    ' <summary>
    ' Direct3D device we are going to draw on.
    ' </summary>
    Private device As Device

    Public Vert As CustomVertex.PositionNormalColored()

    Public VertBuffer As VertexBuffer = Nothing

    Public Sub MakeBlock()
        Vert = New CustomVertex.PositionNormalColored(35) {}

        ' Front face
        Dim iColor As Integer = Color.Red.ToArgb
        Vert(0) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        Vert(1) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        Vert(2) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(3) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        Vert(4) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        Vert(5) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, -0.5F, 0.0F, 0.0F, -1.0F, iColor)
        iColor = Color.Green.ToArgb

        ' Right hand face
        Vert(6) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, -0.5F, 1.0F, 0.0F, 0.0F, iColor)
        Vert(7) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, -0.5F, 1.0F, 0.0F, 0.0F, iColor)
        Vert(8) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 1.0F, 0.0F, 0.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(9) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, -0.5F, 1.0F, 0.0F, 0.0F, iColor)
        Vert(10) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, 0.5F, 1.0F, 0.0F, 0.0F, iColor)
        Vert(11) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 1.0F, 0.0F, 0.0F, iColor)
        iColor = Color.Blue.ToArgb

        ' Bottom face
        Vert(12) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, -0.5F, 0.0F, -1.0F, 0.0F, iColor)
        Vert(13) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, -0.5F, 0.0F, -1.0F, 0.0F, iColor)
        Vert(14) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 0.0F, -1.0F, 0.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(15) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, -0.5F, 0.0F, -1.0F, 0.0F, iColor)
        Vert(16) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 0.0F, -1.0F, 0.0F, iColor)
        Vert(17) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, 0.5F, 0.0F, -1.0F, 0.0F, iColor)
        iColor = Color.Yellow.ToArgb

        ' Left hand face
        Vert(18) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, -0.5F, -1.0F, 0.0F, 0.0F, iColor)
        Vert(19) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, 0.5F, -1.0F, 0.0F, 0.0F, iColor)
        Vert(20) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, -1.0F, 0.0F, 0.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(21) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, -1.0F, 0.0F, 0.0F, iColor)
        Vert(22) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, 0.5F, -1.0F, 0.0F, 0.0F, iColor)
        Vert(23) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, 0.5F, -1.0F, 0.0F, 0.0F, iColor)
        iColor = Color.Orange.ToArgb

        ' Back face
        Vert(24) = New CustomVertex.PositionNormalColored(-0.5F, -0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        Vert(25) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        Vert(26) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(27) = New CustomVertex.PositionNormalColored(0.5F, -0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        Vert(28) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        Vert(29) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, 0.5F, 0.0F, 0.0F, 1.0F, iColor)
        iColor = Color.Cyan.ToArgb

        ' Top face
        Vert(30) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, 0.0F, 1.0F, 0.0F, iColor)
        Vert(31) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, 0.5F, 0.0F, 1.0F, 0.0F, iColor)
        Vert(32) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, 0.5F, 0.0F, 1.0F, 0.0F, iColor)
        iColor = Color.White.ToArgb()
        Vert(33) = New CustomVertex.PositionNormalColored(-0.5F, 0.5F, -0.5F, 0.0F, 1.0F, 0.0F, iColor)
        Vert(34) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, 0.5F, 0.0F, 1.0F, 0.0F, iColor)
        Vert(35) = New CustomVertex.PositionNormalColored(0.5F, 0.5F, -0.5F, 0.0F, 1.0F, 0.0F, iColor)

        VertBuffer = New VertexBuffer( _
            GetType(CustomVertex.PositionNormalColored), _
            Vert.Length, _
            device, _
            Usage.WriteOnly, _
            CustomVertex.PositionNormalColored.Format, _
            Pool.SystemMemory)
    End Sub

    Private scale1 As Matrix
    Private scale2 As Matrix

    Private rot1 As Matrix
    Private rot2 As Matrix

    Private pos1 As Matrix
    Private pos2 As Matrix

    Public Function Init() As Boolean
        Try

            Dim presentParams As PresentParameters = New PresentParameters
            presentParams.Windowed = True
            presentParams.SwapEffect = SwapEffect.Discard
            presentParams.EnableAutoDepthStencil = True
            presentParams.AutoDepthStencilFormat = DepthFormat.D16

            device = New Device(0, DeviceType.Default, Me, CreateFlags.None, presentParams)

            device.RenderState.Lighting = True

            device.Lights(0).Diffuse = Color.Blue
            device.Lights(0).Type = LightType.Directional
            device.Lights(0).Direction = New Vector3(-0.5F, -0.5F, 0.5F)
            device.Lights(0).Update()
            device.Lights(0).Enabled = True

            device.Lights(1).Diffuse = Color.White
            device.Lights(1).Type = LightType.Directional
            device.Lights(1).Direction = New Vector3(0.5F, 0.5F, 0.5F)
            device.Lights(1).Update()
            device.Lights(1).Enabled = True

            device.RenderState.Ambient = Color.White

            device.Transform.View = Matrix.LookAtLH(New Vector3(0.0F, 0.0F, -3.0F), New Vector3(0.0F, 0.0F, 0.0F), New Vector3(0.0F, 1.0F, 0.0F))

            device.Transform.Projection = Matrix.PerspectiveFovLH(CType(Math.PI, Single) / 4, 1.0F, 1.0F, 100.0F)

            MakeBlock()

            iImageBackground = New ImageBackground(device, assembly.GetManifestResourceStream("Block.Background.png"), 3.0F, 0.2F)

            scale1 = Matrix.Scaling(0.6F, 0.6F, 0.6F)
            scale2 = Matrix.Scaling(0.6F, 0.6F, 0.6F)

            rot1 = Matrix.RotationYawPitchRoll(0.5F, 0.5F, 0.5F)
            rot2 = Matrix.RotationYawPitchRoll(-0.5F, -0.5F, -0.5F)

            pos1 = Matrix.Translation(-0.6F, 0.6F, 0)
            pos2 = Matrix.Translation(0.6F, -0.6F, 0)
        Catch ex As Exception
            Return False
        End Try

        Return True
    End Function

    ''' <summary>
    ''' The yaw value for our segment to animate the tumble
    ''' </summary>
    Public Yaw As Single

    ''' <summary>
    ''' Change value for the yaw. Set at random when the
    ''' segment is constructed.
    ''' </summary>
    Public YawSpeed As Single = 0.07F

    ''' <summary>
    ''' The pitch value for our segment to animate the tumble
    ''' </summary>
    Public Pitch As Single

    ''' <summary>
    ''' Change value for the pitch. Set at random when the
    ''' segment is constructed.
    ''' </summary>
    ''' <remarks></remarks>
    Public PitchSpeed As Single = 0.05F

    ''' <summary>
    ''' The roll value for our segment to animate the tumble
    ''' </summary>
    Public Roll As Single

    ''' <summary>
    ''' Change value for the roll. Set at random when the
    ''' segment is constructed.
    ''' </summary>
    ''' <remarks></remarks>
    Public RollSpeed As Single = 0.1F

    Private Sub Render()
        device.Clear(ClearFlags.Target Or ClearFlags.ZBuffer, Color.LightGray, 1.0F, 0)

        device.BeginScene()

        'iImageBackground.Draw(device)

        Yaw += YawSpeed
        Pitch += PitchSpeed
        Roll += RollSpeed

        Dim rrot As Matrix = Matrix.RotationYawPitchRoll(Yaw, Pitch, Roll)

        ' Set the data in the vertex buffer to our triangles
        VertBuffer.SetData(Vert, 0, LockFlags.None)

        ' block 1
        device.Transform.World = scale1 * rrot * rot1 * pos1

        ' Point the device at our vertex buffer
        device.SetStreamSource(0, VertBuffer, 0)

        ' Ask the device to draw the contents of the buffer
        device.DrawPrimitives(PrimitiveType.TriangleList, 0, 12)

        ' block 2
        device.Transform.World = scale2 * rrot * rot2 * pos2

        ' Ask the device to draw the contents of the buffer
        device.DrawPrimitives(PrimitiveType.TriangleList, 0, 12)

        device.EndScene()
        device.Present()
    End Sub

    Private Sub updateTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updateTimer.Tick
        Me.Invalidate()
    End Sub

#Region "Event handlers"
    Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
    End Sub

    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        Render()
    End Sub
#End Region


    Private Sub exitMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitMenuItem.Click
        Application.Exit()
    End Sub

End Class

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看欧美精品| 日本一区二区动态图| 久久伊99综合婷婷久久伊| 最近中文字幕一区二区三区| 日韩精品电影在线| 99久久精品免费看国产| 精品国产一区二区三区四区四| 国产精品国产自产拍高清av| 久久国产精品72免费观看| 99综合电影在线视频| 久久久99精品免费观看不卡| 三级亚洲高清视频| 欧美婷婷六月丁香综合色| 国产精品国产三级国产aⅴ入口 | 日韩毛片在线免费观看| 日日夜夜精品免费视频| 一本色道亚洲精品aⅴ| 中日韩av电影| 国产毛片精品视频| 日韩精品一区二区三区四区视频| 亚洲美女电影在线| 成人永久看片免费视频天堂| 欧美草草影院在线视频| 日本91福利区| 欧美另类变人与禽xxxxx| 亚洲一区二区精品久久av| 99视频有精品| 中文字幕精品一区二区精品绿巨人| 韩国成人福利片在线播放| 日韩午夜激情免费电影| 丝袜美腿成人在线| 制服丝袜日韩国产| 日韩精品电影在线观看| 欧美一卡二卡三卡| 青草国产精品久久久久久| 欧美一区二区三区四区视频| 午夜电影网亚洲视频| 777久久久精品| 免费成人性网站| 日韩欧美成人一区二区| 国产在线播放一区| 中文一区在线播放| 99在线精品观看| 亚洲精品视频一区二区| 色噜噜夜夜夜综合网| 亚洲国产欧美日韩另类综合| 欧美日韩一本到| 美女网站色91| 国产午夜精品一区二区| proumb性欧美在线观看| 亚洲精品日日夜夜| 欧美日韩激情在线| 麻豆一区二区三| 久久久久国产精品厨房| 懂色av一区二区夜夜嗨| 亚洲欧美日韩电影| 欧美亚洲动漫制服丝袜| 紧缚捆绑精品一区二区| 中文字幕第一区二区| 日本丶国产丶欧美色综合| 日韩福利视频网| 久久久不卡网国产精品一区| 波多野结衣中文字幕一区| 亚洲一区国产视频| 日韩亚洲欧美成人一区| youjizz国产精品| 午夜成人在线视频| 国产日韩欧美激情| 欧美日韩精品系列| 国产成人免费视| 午夜精品视频一区| 中文字幕不卡三区| 欧美一区二区三区公司| 成人免费三级在线| 日本美女视频一区二区| 国产精品短视频| 日韩欧美国产一区二区三区 | 麻豆一区二区99久久久久| 国产精品另类一区| 在线不卡a资源高清| 成人免费视频caoporn| 日本欧美一区二区| 亚洲精品亚洲人成人网| 久久久蜜桃精品| 欧美一区二区三区公司| 色综合久久88色综合天天免费| 久久99国产精品久久| 亚洲乱码国产乱码精品精小说| 欧美精品一区二区久久婷婷| 一本久久a久久免费精品不卡| 国产一区二区精品久久| 天堂精品中文字幕在线| 一区二区三区四区高清精品免费观看 | 捆绑调教一区二区三区| 亚洲黄色在线视频| 国产精品免费久久| 久久免费美女视频| 精品国产一区二区三区忘忧草| 欧美视频精品在线观看| 91在线观看下载| 国产成人综合网站| 黄色日韩三级电影| 久久99这里只有精品| 视频一区二区中文字幕| 亚洲女人的天堂| 日韩伦理电影网| 中文字幕中文字幕在线一区 | 欧美一区二区日韩一区二区| 91首页免费视频| 成人不卡免费av| 国产福利91精品| 国产精品资源网站| 极品美女销魂一区二区三区| 麻豆91在线看| 六月丁香婷婷色狠狠久久| 日本成人在线不卡视频| 日韩国产精品久久久久久亚洲| 性久久久久久久久| 午夜精品视频在线观看| 日本vs亚洲vs韩国一区三区二区 | 久久精工是国产品牌吗| 久久99精品一区二区三区| 日本中文字幕不卡| 免费黄网站欧美| 国产一区在线观看麻豆| 国产美女娇喘av呻吟久久| 国产精品系列在线播放| 成人精品gif动图一区| 97精品视频在线观看自产线路二| fc2成人免费人成在线观看播放 | 国产伦精品一区二区三区视频青涩| 久久精品噜噜噜成人av农村| 激情综合色综合久久| 国产精品一区免费在线观看| 成人高清免费观看| 欧美综合在线视频| 日韩三级免费观看| 国产日韩综合av| 亚洲综合一二区| 久久精品国产免费看久久精品| 国产精品77777竹菊影视小说| 99精品国产视频| 欧美视频一区二区三区| 日韩欧美精品三级| 国产精品传媒入口麻豆| 亚洲国产精品欧美一二99| 精品一区二区久久久| fc2成人免费人成在线观看播放| 欧美日韩中文精品| 久久一二三国产| 亚洲第一主播视频| 国产99久久久国产精品| 欧美三级视频在线播放| 精品国产欧美一区二区| 亚洲精品视频在线观看网站| 蜜臀久久久久久久| 91在线精品秘密一区二区| 日韩一区国产二区欧美三区| 国产精品色在线观看| 青青草伊人久久| 色综合色狠狠综合色| 欧美精品一区二| 亚洲午夜私人影院| 丁香五精品蜜臀久久久久99网站| 欧美日韩国产bt| 中文字幕色av一区二区三区| 美女视频黄 久久| 在线观看视频一区二区欧美日韩| 久久久五月婷婷| 美女尤物国产一区| 欧美影院精品一区| 亚洲欧美怡红院| 激情久久五月天| 69精品人人人人| 亚洲精品成人a在线观看| 国产精品1区2区| 日韩欧美一区二区三区在线| 一区二区三区中文在线| 亚洲三级在线观看| 懂色av一区二区三区免费观看| 久久97超碰国产精品超碰| 日本电影欧美片| 国产精品色呦呦| 国产剧情一区二区| 精品国产免费人成电影在线观看四季| 一区二区日韩av| 99久久婷婷国产综合精品| 国产亚洲va综合人人澡精品| 青青草精品视频| 在线不卡一区二区| 亚洲国产精品嫩草影院| 在线观看一区二区精品视频| 中文字幕精品一区| 粗大黑人巨茎大战欧美成人| 久久精品视频一区二区| 国产精品自在欧美一区| 久久久噜噜噜久噜久久综合| 精品一区免费av| 国产日韩欧美一区二区三区综合| 国产九色精品成人porny|