void LineRel2D(float dx, float dy) { dx += x_current; dy += y_current; DrawLine2D(x_current, y_current, dx, dy); x_current = dx; y_current = dy; }
void CursorTrail::draw() { DrawLine2D(10.f, Color3f(.725f, .619f, 0.56f)); }
void LineAbs2D(float x, float y) { DrawLine2D(x_current, y_current, x, y); x_current = x; y_current = y; }
virtual void _Draw() { DrawLine2D(x1, y1, x2, y2); }
void TScene::DrawRadarLabel(Vector pos) { // Draw Radar Slots glMatrixMode(GL_MODELVIEW); Vector col(0.25f,0.25f,0); // DrawLine2D(0.3f,0,0.7f,0,Vector(1,1,0)); DrawLine2D(0.7f,0,0.7f,0.3f,col); DrawLine2D(0.7f,0.3f,0.3f,0.3f,col); DrawLine2D(0.3f,0.3f,0.3f,0,col); DrawLine2D(0.3f,1,0.3f,0.7f,col); DrawLine2D(0.3f,0.7f,0.7f,0.7f,col); DrawLine2D(0.7f,0.7f,0.7f,1,col); Vector lskPos(0,0,0),lskPos2(0,0,0),tmpV(0,0,0); float tmp=0; OGLMath_VectorMatrixMultiply( lskPos, pos, Camera->CameraMatrix); lskPos2=lskPos; /* float mmodel[16]={0}; gluLookAt(0,0,0,dir.x,dir.y,dir.z,up.x,up.y,up.z); // glPushMatrix(); glGetFloatv(GL_MODELVIEW_MATRIX, mmodel); // glPopMatrix(); glLoadIdentity(); glTranslatef(pos.x, pos.y, pos.z); glMultTransposeMatrixf(mmodel);*/ //Camera->Apply(); float l=2000.0f-GetVectorLength(Camera->GetPosition()-pos); lskPos.x=lskPos.x/(3000.0f-l)+0.5f+0.35f; lskPos.y=lskPos.y/(3000.0f-l);//+0.5f; lskPos.z=-lskPos.z/(3000.0f-l)+0.5f-0.35f; if (lskPos.y>0.3f) lskPos.y=0.3f; if (lskPos.y<-0.3f) lskPos.y=-0.3f; DrawLine2D(lskPos.x, lskPos.z, lskPos.x, lskPos.z+lskPos.y, Vector(1,1,1)); DrawLine2D(lskPos.x, lskPos.z+lskPos.y, lskPos.x+0.01f, lskPos.z+lskPos.y, Vector(1,1,1)); DrawLine2D(0.85-0.01f,0.15,0.85+0.01f,0.15,Vector(1,1,1)); DrawLine2D(0.85,0.15-0.01f,0.85,0.15+0.01f,Vector(1,1,1)); // Draw Label of Sphere Radar float mmodel[16]={0}; glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0,0,10,0,2.3f,1,0,1,0); glGetFloatv(GL_MODELVIEW_MATRIX, mmodel); lskPos2=NormalizeVector(lskPos2)*1.2f; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMultMatrixf(ProjectionMatrix); glMultMatrixf(mmodel); glMatrixMode(GL_MODELVIEW); // tmpV=Camera->GetPosition(); // DrawLine(Vector(tmpV.x,tmpV.y,tmpV.z-1.0f),Vector(tmpV.x+50.0f,tmpV.y+50.0f,tmpV.z-100.0f), Vector(1,1,1)); // DrawLine(Vector(0,0,0),Vector(100,100,-100),Vector(1,1,1)); DrawLine(Vector(0,0,0),lskPos2,Vector(1,1,1)); // glBlendFunc(GL_SRC_ALPHA,GL_NONE); // Select The Type Of Blending // glEnable(GL_COLOR_MATERIAL); // glDisable(GL_LIGHTING); // glDisable(GL_LIGHT0); RenderPlanet(0.25f,Vector(0,0,0),6); // glEnable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glMultMatrixf(ProjectionMatrix); glMultMatrixf(Camera->CameraMatrix); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); }
void iGraphics::draw_line (int x1, int y1, int x2, int y2) { DrawLine2D (x1, invert (y1), x2, invert (y2)); };