indexing description: "Objects that ..." author: "" date: "$Date$" revision: "$Revision$" class TEXTURE_SCENE inherit OBJECT_SCENE redefine initialize_scene, predraw, draw end EMGL_SETTINGS export {NONE} all end EMGL_VIEW export {NONE} all end create make feature {NONE} -- Initialisation initialize_scene is -- Set up EM3D stuff local plane_node: EM3D_SCENE_NODE do Precursor create plane.make( scene_manager ) plane_node := scene_manager.world.new_child plane_node.translate ( [0,-1,0] ) plane_node.attach_object ( plane ) end feature -- Access plane: REFLECTION_PLANE mirrored: BOOLEAN feature -- Drawing predraw is -- Update the reflection_plane do mirrored := true plane.update_texture( agent opengl_draw ) mirrored := false end draw is -- We need to mirror the scene do if mirrored then -- Quick and dirty hack because the plane has benn moved emgl_translate( [0,-1,0] ) emgl_scale( [1,-1,1] ) emgl_translate( [0,1,0] ) -- Since we reversed only the y axis the order of the polygon has changed emgl_cull_face ( em_gl_front ) else -- We now use the normal order emgl_cull_face ( em_gl_back ) end Precursor end end