# [.net] What is proj(0, 0) for projection matrix?

This topic is 4977 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I'm trying to work out pick ray method using a bounding sphere and sometimes in the C++ examples online I see "proj(0, 0)" for a projection matrix, what is the (0,0) for and what would the conversion of it be in VB.Net or C#? Thanks!

##### Share on other sites
Could you provide a specific example of where you see this or at least some kind of source snippet?

##### Share on other sites
Calculate Picking Ray Converted from Game Programming Book.

VB.Net Sample:
Public Function CalculatePickingRay(ByVal x As Integer, ByVal y As Integer) As Ray
Dim px As Single = 0.0F
Dim py As Single = 0.0F
Dim vp As Microsoft.DirectX.Direct3D.Viewport = Direct3DDevice.Viewport

'The default view transformation matrix is the identity matrix.
Dim proj As Matrix = mobjDX9.Transform.Projection

'This may be a problem...
'==CODE HERE INVALID==.
px = (((2.0F * x) / vp.Width) - 1.0F) / proj(0, 0)
py = (((-2.0F * y) / vp.Height) + 1.0F) / proj(1,1)

'Note:
'proj(0, 0) and proj(1, 1) cannot be used in the lines above therefore it is invalid.
'==END OF INVALID CODE==.

Dim ray As Ray
ray.origin = New Vector3(0.0F, 0.0F, 0.0F)
ray.direction = New Vector3(px, py, 1.0F)
Return ray
End Function

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 9
• 9
• 9
• 46
• 41
• ### Forum Statistics

• Total Topics
631750
• Total Posts
3002065
×