ThePentiumGuy Posted June 22, 2004 Posted June 22, 2004 Are Lights Transformed Or Not? :) pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
ThePentiumGuy Posted June 22, 2004 Author Posted June 22, 2004 also another q, im just gonna post it here becuase i dont wanna make too many posts, when you check for collision - does the Mesh.Intersect "know about" the trasnformed positions? meaning, if you keep the car msh in the same place, but you move the platform when you check for collision using platform.intersect(car.position, new v3(0,1,0)), would the mesh.intersect 'realize' taht the platform has been moving down the entire time, or will it just use the model space positions (which havent been transformed) pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
rifter1818 Posted June 22, 2004 Posted June 22, 2004 Not sure about lights But you can use mesh.intersect and whatever you check will be translated by the current world matrix should my memory serve me correct. Quote
ThePentiumGuy Posted June 22, 2004 Author Posted June 22, 2004 oh, it has to be the *world matrix* ? becuase im using the view matrix LookatLH to change my positions and stuff pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Kavan Posted June 22, 2004 Posted June 22, 2004 Lights are not transformed = they are in world space Mesh.Intersect does not know of transformations = it works in model space Quote
rifter1818 Posted June 23, 2004 Posted June 23, 2004 Are you sure about the Mesh.Intersect thing Kavan cause i remember using only one mesh (a 2 triangle square) for all my intersects by translating it around my grid. (looks for code). Quote
ThePentiumGuy Posted June 23, 2004 Author Posted June 23, 2004 rifter: what Kavan said seems to be right becuase all you're inputting in the arguments are the position and direction. if it was in world space, it would be even more confusing btw - i tried this out - i translated thje world in various places, and tried mesh.intersect and the collision happens in the same place every time - no matter where you translate the world, so i think its model space coordinates thanks both of you pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
rifter1818 Posted June 29, 2004 Posted June 29, 2004 Um then this shouldnt have worked However the following worked for using a single (150x150x0) square mesh to check the tops of a (3x150)x(2x150) landscape. For i = 0 To blgrid.GetUpperBound(0) For i2 = 0 To blgrid.GetUpperBound(1) If blgrid(i, i2).Exsists Then D3d.Device.Transform.World = D3d.Translate(blgrid(i, i2).pos.X, blgrid(i, i2).Alt, blgrid(i, i2).pos.Y) v3dmouse = Vector3.Subtract(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, 100))) If modBattle.GridTopMesh.Intersect(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), v3dmouse) Then BLP.x = i BLP.y = i2 Exit Sub End If End If Next Next Quote
ThePentiumGuy Posted June 29, 2004 Author Posted June 29, 2004 However the following worked for using a single (150x150x0) square mesh to check the tops of a (3x150)x(2x150) landscape. [/size] [size=1] [/size] [size=1]For i = 0 To blgrid.GetUpperBound(0)[/size] [size=1]For i2 = 0 To blgrid.GetUpperBound(1)[/size] [size=1]If blgrid(i, i2).Exsists Then[/size] [size=1]D3d.Device.Transform.World = D3d.Translate(blgrid(i, i2).pos.X, blgrid(i, i2).Alt, blgrid(i, i2).pos.Y)[/size] [size=1]v3dmouse = Vector3.Subtract(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, 100)))[/size] [size=1]If modBattle.GridTopMesh.Intersect(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), v3dmouse) Then[/size] [size=1]BLP.x = i[/size] [size=1]BLP.y = i2[/size] [size=1]Exit Sub[/size] [size=1]End If[/size] [size=1]End If[/size] [size=1]Next[/size] [size=1]Next[/size] [size=1] sry man im not that advanced in d3d yet to understand this :-\ Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
rifter1818 Posted June 30, 2004 Posted June 30, 2004 ok Im sure youd figure it out if you put your mind to it but its using mesh.intersect with world matrix translations (so i was right (im pretty sure)). Quote
Kavan Posted June 30, 2004 Posted June 30, 2004 It just seems so. In fact the main part is done in D3d. I'm not sure what that is, but it looks like some library (not MDX). Quote
rifter1818 Posted June 30, 2004 Posted June 30, 2004 D3d is just a wrapper class of Edit(Managed) directx (custom made by yours truely) Most of its usefullness is in other areas such as Skinning Meshs where it has working implementations and has some good vertexBuffer constructors and such nothing really impressive. Quote
Kavan Posted July 1, 2004 Posted July 1, 2004 Ok, but the main part is done using Unproject. I guess this one uses the currently set world matrix. You could use Vector3.Unproject to get the same result without setting world matrix. Quote
ThePentiumGuy Posted July 1, 2004 Author Posted July 1, 2004 ..so basically mesh.intersect knows of transformations (i honestly don't know what all this unprojcet stuff does - i havent really done any linear algebra yet - only in 10th grade) Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
rifter1818 Posted July 2, 2004 Posted July 2, 2004 Vector3.unproject takes in the world matrix. (and viewport and one other matrix (cant think of it off the top of my head)). So yes thats where all of the World matrix transformations are accounted for. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.