|
-
Nov 14th, 2005, 10:52 PM
#1
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:
D3DXMatrixIdentity Transformation_Matrix(0)
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
D3DXMatrixMultiply Transformation_Matrix(0), World_Transformation_Matrix, Camera_Transformation_Matrix
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:
Sub cullVertexToViewFrustum(ByRef MatViewProj as D3DXMATRIX, x As Float, y As Float, z As Float) As Boolean
Dim p As D3DXPLANE
'left plane
p.a=MatViewProj.m(0,3)+MatViewProj.m(0,0)
p.b=MatViewProj.m(1,3)+MatViewProj.m(1,0)
p.c=MatViewProj.m(2,3)+MatViewProj.m(2,0)
p.d=MatViewProj.m(3,3)+MatViewProj.m(3,0)
D3DXPlaneNormalize p,p
If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
Return True
'right plane
p.a=MatViewProj.m(0,3)-MatViewProj.m(0,0)
p.b=MatViewProj.m(1,3)-MatViewProj.m(1,0)
p.c=MatViewProj.m(2,3)-MatViewProj.m(2,0)
p.d=MatViewProj.m(3,3)-MatViewProj.m(3,0)
D3DXPlaneNormalize p,p
If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
Return True
'top plane
p.a=MatViewProj.m(0,3)-MatViewProj.m(0,1)
p.b=MatViewProj.m(1,3)-MatViewProj.m(1,1)
p.c=MatViewProj.m(2,3)-MatViewProj.m(2,1)
p.d=MatViewProj.m(3,3)-MatViewProj.m(3,1)
D3DXPlaneNormalize p,p
If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
Return True
'bottom plane
p.a=MatViewProj.m(0,3)+MatViewProj.m(0,1)
p.b=MatViewProj.m(1,3)+MatViewProj.m(1,1)
p.c=MatViewProj.m(2,3)+MatViewProj.m(2,1)
p.d=MatViewProj.m(3,3)+MatViewProj.m(3,1)
D3DXPlaneNormalize p,p
If ((p.a*x)+(p.b*y)+(p.c*z)+p.d)<=0
Return True
Return False
End Sub
-
Nov 15th, 2005, 02:00 AM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 15th, 2005, 06:53 AM
#3
Re: DirectX8 Getting Transformed Vertices
Private Calendar?
-
Nov 22nd, 2005, 04:43 AM
#4
Fanatic Member
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
-
Dec 5th, 2005, 09:46 PM
#5
Re: DirectX8 Getting Transformed Vertices
 Originally Posted by shirazamod
Why not get a Gmail account & then you can store all your data in there?
Cause I'm too lazy.
-
Dec 6th, 2005, 11:13 AM
#6
Re: DirectX8 Getting Transformed Vertices
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|