Results 1 to 6 of 6

Thread: DirectX8 Getting Transformed Vertices

  1. #1

    Thread Starter
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    DirectX8 Getting Transformed Vertices

    Just incase GameDev and my Hotmail account are inactive cause of server issues (like today), I'm gonna make a backup of my code for obtaining transformed vertices in DirectX8, which is rare and hard to find:

    VB Code:
    1. D3DXMatrixIdentity Transformation_Matrix(0)
    2. Temp_Vertex.X = Vertex_List(0).X: Temp_Vertex.Y = Vertex_List(0).Y: Temp_Vertex.Z = Vertex_List(0).Z: Temp_Vertex.W = 1
    3. D3DXMatrixMultiply Transformation_Matrix(0), World_Transformation_Matrix, Camera_Transformation_Matrix
    4. D3DXMatrixMultiplyByVertex Transformation_Vertex(0), Transformation_Matrix(0), Temp_Vertex

    And also, I'm gonna need this C++ guru's crappy VB attempt yet working (after I fix it) "Test if vertex is within viewing frustrum" code:

    VB Code:
    1. Sub cullVertexToViewFrustum(ByRef MatViewProj as D3DXMATRIX, x As Float, y As Float, z As Float) As Boolean
    2.     Dim p As D3DXPLANE
    3.  
    4.     'left plane
    5.     p.a=MatViewProj.m(0,3)+MatViewProj.m(0,0)
    6.     p.b=MatViewProj.m(1,3)+MatViewProj.m(1,0)
    7.     p.c=MatViewProj.m(2,3)+MatViewProj.m(2,0)
    8.     p.d=MatViewProj.m(3,3)+MatViewProj.m(3,0)
    9.     D3DXPlaneNormalize p,p
    10.     If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
    11.         Return True
    12.  
    13.     'right plane
    14.     p.a=MatViewProj.m(0,3)-MatViewProj.m(0,0)
    15.     p.b=MatViewProj.m(1,3)-MatViewProj.m(1,0)
    16.     p.c=MatViewProj.m(2,3)-MatViewProj.m(2,0)
    17.     p.d=MatViewProj.m(3,3)-MatViewProj.m(3,0)
    18.     D3DXPlaneNormalize p,p
    19.     If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
    20.         Return True
    21.  
    22.     'top plane
    23.     p.a=MatViewProj.m(0,3)-MatViewProj.m(0,1)
    24.     p.b=MatViewProj.m(1,3)-MatViewProj.m(1,1)
    25.     p.c=MatViewProj.m(2,3)-MatViewProj.m(2,1)
    26.     p.d=MatViewProj.m(3,3)-MatViewProj.m(3,1)
    27.     D3DXPlaneNormalize p,p
    28.     If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
    29.         Return True
    30.  
    31.     'bottom plane
    32.     p.a=MatViewProj.m(0,3)+MatViewProj.m(0,1)
    33.     p.b=MatViewProj.m(1,3)+MatViewProj.m(1,1)
    34.     p.c=MatViewProj.m(2,3)+MatViewProj.m(2,1)
    35.     p.d=MatViewProj.m(3,3)+MatViewProj.m(3,1)
    36.     D3DXPlaneNormalize p,p
    37.     If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
    38.         Return True
    39.  
    40.     Return False
    41. End Sub

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: DirectX8 Getting Transformed Vertices

    You could always post this in your Private Calendar if you want. No explainations needed.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: DirectX8 Getting Transformed Vertices

    Private Calendar?

  4. #4
    Fanatic Member
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    760

    Re: DirectX8 Getting Transformed Vertices

    Why not get a Gmail account & then you can store all your data in there.
    Contact me if you need an invite
    If I helped you out, please consider adding to my reputation!

    -- "The faulty interface lies between the chair and the keyboard" --

    VB6 Programs By Me:
    ** Dictionary, Thesaurus & Rhyme-Generator In One ** WMP Recent Files List Editor ** Pretty Impressive Clock ** Extract Firefox History **

  5. #5

    Thread Starter
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: DirectX8 Getting Transformed Vertices

    Quote Originally Posted by shirazamod
    Why not get a Gmail account & then you can store all your data in there?
    Cause I'm too lazy.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: DirectX8 Getting Transformed Vertices

    Quote Originally Posted by Jacob Roman
    Private Calendar?
    Private Calendar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width