//! Draws hardcoded platern that we start over //! This is a temporary function since land will be migrated to the databse void DrawLandscape() { IPicker3dModel picker3dmodel = RendererFactory.GetPicker3dModel(); int i, iy; // Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, new float[]{(float)rand.GetRandomFloat(0,1), 0.7f, 0.2f, 1.0f}); Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, new float[] { 0.7f, 0.7f, 0.2f, 1.0f }); int iLandCoord = 0; for (iy = -10; iy <= 10; iy++) { for (i = -10; i <= 10; i++) { LandCoords[iLandCoord] = new Vector2(-10.0F + i * 1.0F, -10.0F + iy * 1.0F); picker3dmodel.AddHitTarget(new HitTargetLandCoord(iLandCoord)); graphics.PushMatrix(); graphics.Translate(-10.0F + i * 1.0F, -10.0F + iy * 1.0F, MetaverseClient.GetInstance().fHeight - 0.5); graphics.DrawCube(); graphics.PopMatrix(); iLandCoord++; } } }
void DrawSingleEditHandle(Vector3 entityscale, Vector3 handlescale, Axis handleaxis) { graphics.PushMatrix(); graphics.SetMaterialColor(editing3d.GetEditHandleColor(handleaxis)); RendererFactory.GetPicker3dModel().AddHitTarget(new HitTargetEditHandle(new Axis(handleaxis))); double fTranslateAmount = (handleaxis.GetAxisComponentIgnoreAxisDirection(entityscale) + handleaxis.GetAxisComponentIgnoreAxisDirection(handlescale)) / 2; graphics.Translate(fTranslateAmount * handleaxis.ToVector()); graphics.Scale(handlescale); graphics.Rotate(handleaxis.ToRot()); graphics.DrawCube(); graphics.PopMatrix(); }
public override void Draw() { // Test.Debug("cube draw"); IGraphicsHelper graphics = GraphicsHelperFactory.GetInstance(); graphics.PushMatrix(); // Test.Debug( this.ToString() ); graphics.SetMaterialColor(facecolors[0]); graphics.Translate(pos); graphics.Rotate(rot); graphics.Scale(scale); graphics.DrawCube(); graphics.PopMatrix(); }