Get the screen position of some vertex?

how do i get the screen position of some vertex or object pivot?

something like the mouse.screenpos.. but for objects

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

From maxscript

From maxscript reference: Coordinate Transformation Methods The following methods map points from the graphic window's current transform to device space. If the graphic window's transform is set to the identity matrix then the mapping is done from points specified in world space. Otherwise the points given are transformed by the graphic window’s transform, and are then considered to be in world space. Thus, to get a world-space to screen-space conversion, you need to set the graphic window’s transform to the identity with CODE: gw.setTransform(Matrix3 1) gw.hTransPoint This method converts the point3 coordinate to a "h" format device coordinate. Each component of the return value is in integer format in the native device coordinates for the graphics driver. For HEIDI and OpenGL, the origin is at the lower left. For Direct3D the origin is at the upper left. gw.wTransPoint This method converts the point3 coordinate to a "w" format device coordinate. Each component of the return value is in integer format with the origin at the upper left. gw.transPoint This method converts the point3 coordinate to a "h" floating point coordinate. Each component of the return value is in float format with the origin at the upper left. This is just a helper routine to avoid building up round-off error. 3ds Max uses it just for IK.

 

You can check this script for real world example:

mjbg's picture

Thank you for the fast

Thank you for the fast answer

Only one more question. Using this method i can get the viewport position, not the screen position. There is any way to get the screen position??

well.. thanks anyway, i will look to that script

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.