public void DrawText(Vector3D location, string message) { R3DVector2D nameLoc = new R3DVector2D(); Vector2D loc2d = View.ProjectPoint(location); nameLoc.x = loc2d.X; nameLoc.y = loc2d.Y; Engine.Interface5D.Primitive_DrawText(ref nameLoc, message); }
/* * public void SetHeading( Vector3D heading ) { * setPointer; * R3DPoint3D p; * p.x = heading.X + _position.X; * p.y = heading.Y + _position.Y; * p.z = heading.Z + _position.Z; * Engine.Cameras.Camera_LookAt( ref p ); * } */ #endregion #region "Methods" public Vector2D ProjectPoint(Vector3D point) { R3DVector3D namePos = new R3DVector3D(); namePos.x = point.X; namePos.y = point.Y; namePos.z = point.Z; R3DVector2D nameLoc = new R3DVector2D(); nameLoc = Engine.Cameras.Camera_ProjectPoint(ref namePos); return(new Vector2D(nameLoc.x, nameLoc.y)); }
/// <summary> /// Public rendering routine /// </summary> /// <remarks>This method renders the scene into video memory</remarks> public void Render() { try { Engine.Pipeline.Renderer_Clear(); } catch (Exception e) { throw new RenderingException("Call to 'Clear()' failed", e); } try { Engine.Pipeline.Renderer_Render(); } catch (Exception e) { throw new RenderingException("Call to 'Render()' failed with '" + e.ToString() + "'", e); } //#if DEBUG R3DVector2D zero = new R3DVector2D(); zero.x = 20; zero.y = 20; //R3DColor black = new R3DColor(); //black.b = 255; //black.r = 255; //black.g = 255; //EEERRR setting the draw color fails to write text in 89 //Engine.Interface5D.Primitive_SetDrawColor(ref black); Engine.Interface5D.Primitive_DrawText(ref zero, "Fp/S: " + Engine.PowerMonitor.lGetFramesPerSecond().ToString() + ", Vertices: " + Engine.PowerMonitor.lGetNumVerticesPerSinceLastFrame().ToString() + ", Verts/Sec: " + (Engine.PowerMonitor.lGetFramesPerSecond() * Engine.PowerMonitor.lGetNumVerticesPerSinceLastFrame()).ToString()); // Engine.Interface2D.Primitive_DrawText(0,0, (Engine.PowerMonitor.lGetFramesPerSecond()).ToString()); //#endif /* * try * { * Engine.Pipeline.Renderer_Display(); * } * catch(Exception e) * { * throw new RenderingException("Call to 'Display()' failed with '" + e.ToString() + "'", e); * } */ }
public void DrawText( Vector3D location, string message ) { R3DVector2D nameLoc = new R3DVector2D(); Vector2D loc2d = View.ProjectPoint( location ); nameLoc.x = loc2d.X; nameLoc.y = loc2d.Y; Engine.Interface5D.Primitive_DrawText( ref nameLoc, message ); }
/// <summary> /// Public rendering routine /// </summary> /// <remarks>This method renders the scene into video memory</remarks> public void Render() { try { Engine.Pipeline.Renderer_Clear(); } catch(Exception e) { throw new RenderingException("Call to 'Clear()' failed", e); } try { Engine.Pipeline.Renderer_Render(); } catch(Exception e) { throw new RenderingException("Call to 'Render()' failed with '" + e.ToString() + "'", e); } //#if DEBUG R3DVector2D zero = new R3DVector2D(); zero.x = 20; zero.y = 20; //R3DColor black = new R3DColor(); //black.b = 255; //black.r = 255; //black.g = 255; //EEERRR setting the draw color fails to write text in 89 //Engine.Interface5D.Primitive_SetDrawColor(ref black); Engine.Interface5D.Primitive_DrawText(ref zero, "Fp/S: " + Engine.PowerMonitor.lGetFramesPerSecond().ToString() + ", Vertices: " + Engine.PowerMonitor.lGetNumVerticesPerSinceLastFrame().ToString() + ", Verts/Sec: " + (Engine.PowerMonitor.lGetFramesPerSecond() * Engine.PowerMonitor.lGetNumVerticesPerSinceLastFrame()).ToString() ); // Engine.Interface2D.Primitive_DrawText(0,0, (Engine.PowerMonitor.lGetFramesPerSecond()).ToString()); //#endif /* try { Engine.Pipeline.Renderer_Display(); } catch(Exception e) { throw new RenderingException("Call to 'Display()' failed with '" + e.ToString() + "'", e); } */ }
/* public void SetHeading( Vector3D heading ) { setPointer; R3DPoint3D p; p.x = heading.X + _position.X; p.y = heading.Y + _position.Y; p.z = heading.Z + _position.Z; Engine.Cameras.Camera_LookAt( ref p ); } */ #endregion #region "Methods" public Vector2D ProjectPoint( Vector3D point ) { R3DVector3D namePos = new R3DVector3D(); namePos.x = point.X; namePos.y = point.Y; namePos.z = point.Z; R3DVector2D nameLoc = new R3DVector2D(); nameLoc = Engine.Cameras.Camera_ProjectPoint( ref namePos ); return new Vector2D( nameLoc.x, nameLoc.y ); }