Are Lights Transformed Or Not

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
 
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.
 
Lights are not transformed = they are in world space

Mesh.Intersect does not know of transformations = it works in model space
 
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).
 
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
 
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.
Visual Basic:
        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
 
rifter1818 said:
However the following worked for using a single (150x150x0) square mesh to check the tops of a (3x150)x(2x150) landscape.
rifter1818 said:
Visual Basic:
[/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 :-\
 
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).
 
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.
 
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.
 
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.
 
Back
Top