indexing description: "[ A coordinate frame that sets up the rendering environment for its child box. Use this to draw a EM_VIZ_BOX instead of calling EM_VIZ_BOX.render directly. Viz currently only supports orthographic projections, meaning that with perspective projections back-to-front rendering might fail in certain cases. This will not matter for completely flat scenes, e.g. group-, table-, and text-boxes only. ]" author: "" date: "$Date$" revision: "$Revision$" class EM_VIZ_BOX_FRAME [B -> EM_VIZ_BOX] inherit DS_CELL [B] rename make as make_cell end EM_VIZ_RENDERER EM_VIZ_COORDINATE_FRAME create make_for_opengl_2d, make_for_opengl_3d feature -- Initialization make_for_opengl_2d (a_box: B) is -- Make new frame for `a_box' for 2d OpenGL (see EM3D_ORTHO_SCENE) do make_cell (a_box) make_unit set_z_axis (-z_axis) end make_for_opengl_3d (a_box: B) is -- Make new frame for `a_box' for 3d OpenGL do make_cell (a_box) make_unit set_y_axis (-y_axis) set_z_axis (-z_axis) end feature -- Rendering draw is -- Set up rendering environment and draw child if it exists do vz_push_frame vz_mult_frame (matrix) vz_push_attributes (Vz_all_attribute_bits) vz_set_defaults if item /= Void then item.render (viewing_direction) end vz_pop_attributes vz_pop_frame end feature {NONE} -- Implementation viewing_direction: EM_VECTOR3D is -- Find viewing-direction in Viz-coordinates by -- inverse mapping viewing-direction in OpenGL coordinates. do -- In OpenGL, the z-Axis points at the viewer. Result := inversed.map ([0,0,-1]) end end