Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.50 diff -c -p -r1.50 graphics.h.in *** src/graphics.h.in 28 Jan 2008 22:42:19 -0000 1.50 --- src/graphics.h.in 30 Jan 2008 10:15:27 -0000 *************** public: *** 2192,2197 **** --- 2192,2208 ---- update_camera (); } + ColumnVector transform (double x, double y, double z, + bool use_scale = true) const; + ColumnVector untransform (double x, double y, double z, + bool use_scale = true) const; + + Matrix get_transform_matrix (void) const { return x_render; } + Matrix get_inverse_transform_matrix (void) const { return x_render_inv; } + Matrix get_opengl_matrix_1 (void) const { return x_gl_mat1; } + Matrix get_opengl_matrix_2 (void) const { return x_gl_mat2; } + Matrix get_transform_zlim (void) const { return x_zlim; } + private: scaler sx, sy, sz; Matrix x_render, x_render_inv; Index: src/graphics.cc =================================================================== RCS file: /cvs/octave/src/graphics.cc,v retrieving revision 1.80 diff -c -p -r1.80 graphics.cc *** src/graphics.cc 28 Jan 2008 22:42:19 -0000 1.80 --- src/graphics.cc 30 Jan 2008 10:15:27 -0000 *************** axes::properties::get_boundingbox (void) *** 2068,2073 **** --- 2070,2105 ---- return pos; } + ColumnVector + axes::properties::transform (double x, double y, double z, + bool use_scale) const + { + if (use_scale) + { + x = sx.scale (x); + y = sy.scale (y); + z = sz.scale (z); + } + + return (x_render * xform_vector (x, y, z)); + } + + ColumnVector + axes::properties::untransform (double x, double y, double z, + bool use_scale) const + { + ColumnVector v = (x_render_inv * xform_vector (x, y, z)); + + if (use_scale) + { + v(0) = sx.unscale (v(0)); + v(1) = sy.unscale (v(1)); + v(2) = sz.unscale (v(2)); + } + + return v; + } + octave_value axes::get_default (const caseless_str& name) const {