MatthiasBuehlmann
11-07-2008, 09:34 AM
Hi!
i want to do some raycasting and for this i need a function where i can choose a certain pixel of my render and then create a ray for this pixel.
Currently i'm using the function
M3dView::viewToWorld(short x_pos, short y_pos, MPoing & nearClipPt, MPoint & farClipPt);
i thoght it was working, but i just found out that i get different results, if i resize my viewport. but that's definately not what i want! i want the transformation to be dependant on the matrices used for software rendering, such that my rays correspond to the actual pixels of the render.
So - what else can I use than M3DView::viewToWorld? or how can I make sure that this gives me the right result?
//additional question:
can somebody tell me what the MFnCamera::postProjectionMatrix is good for? the docs are very unspecific on that and i couldn't find anything useful in the web.. thx!
Thanks!
i want to do some raycasting and for this i need a function where i can choose a certain pixel of my render and then create a ray for this pixel.
Currently i'm using the function
M3dView::viewToWorld(short x_pos, short y_pos, MPoing & nearClipPt, MPoint & farClipPt);
i thoght it was working, but i just found out that i get different results, if i resize my viewport. but that's definately not what i want! i want the transformation to be dependant on the matrices used for software rendering, such that my rays correspond to the actual pixels of the render.
So - what else can I use than M3DView::viewToWorld? or how can I make sure that this gives me the right result?
//additional question:
can somebody tell me what the MFnCamera::postProjectionMatrix is good for? the docs are very unspecific on that and i couldn't find anything useful in the web.. thx!
Thanks!
