Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MapViewToScreen matrix

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
609 Views, 6 Replies

MapViewToScreen matrix

Good day, I need help with getting access to matrix that deforms 3d coordinates from world space to screen space... Each point can be transformed in 3ds max sdk by MapViewToScreen function of ViewExp, but if I wish to project a large set of objects, is it possible to get the matrix once and then optimize the deformation via vector operation?

 

Thanks in advance!

Tatiana

6 REPLIES 6
Message 2 of 7
istan
in reply to: Anonymous
Message 3 of 7
Anonymous
in reply to: istan

Thanks istan, 

No, it does not. This is the transform from world coords to the coordinates of the camera, but not the projection to the screen, 

 

actually you first transform your points from world space coordinates with AffineTM matrix to camera coordinate system

(put origin at camera and z aligned with viewing direction, y with up) but then you need to project from 3D to screen with MapViewToScreen,

and do it per point!

 

I wonder if I could simulate the computations to get the matrix exactly or just get some interface to get the projection matrix.

 

Thanks!

Tatiana

Message 4 of 7
denisT.MaxDoctor
in reply to: Anonymous

where is the problem? you have a view (ViewExp*) -> graphic window  (GraphicsWindow*) -> its transform ... what do you need extra?

 

 

Message 5 of 7
Anonymous
in reply to: denisT.MaxDoctor

Sounds as just what I need, Thank you, Denis!
Shall try it...

Message 6 of 7
Anonymous
in reply to: denisT.MaxDoctor

I must admit, I am still lost... What matrix combination do I need to get effect like 

vp->MapViewToScreen(pt);

where vp is ViewExp*, pt is a point in a camera coordinates (not projected, i.e pt = AffineTM * ObjectTM * vLocalPt)? 
let's say I have 1200x720 viewport, then the result should be x in [0, 1200], y in [0, 720]?

 

Thank you!

Message 7 of 7
Anonymous
in reply to: denisT.MaxDoctor

Got it! GetCameraMatrix transforms vertex to NDC, which is even better!

 

Thanks again Denis!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report