?? axis.cpp
字號:
/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-this file is part of rcssserver3DFri May 9 2003Copyright (C) 2002,2003 Koblenz UniversityCopyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group$Id: axis.cpp,v 1.4 2004/04/12 17:19:48 rollmark Exp $This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; version 2 of the License.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#include "axis.h"#include "../openglserver/openglserver.h"#include <kerosin/openglserver/glbase.h>using namespace kerosin;Axis::Axis() : mSize(10.0f){}void Axis::RenderInternal(){ RGBA colX(1,0,0,1); RGBA colY(0,1,0,1); RGBA colZ(0,0,1,1); // X glColor3fv(colX); glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colX); glBegin(GL_LINE_LOOP); glVertex3f(0,0,0); glVertex3f(mSize,0,0); glEnd(); // Y glColor3fv(colY); glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colY); glBegin(GL_LINE_LOOP); glVertex3f(0,0,0); glVertex3f(0,mSize,0); glEnd(); // Z glColor3fv(colZ); glMaterialfv(GL_FRONT_AND_BACK,GL_EMISSION,colZ); glColor3f(0, 0, 1); glBegin(GL_LINE_LOOP); glVertex3f(0,0,0); glVertex3f(0,0,mSize); glEnd();}float Axis::GetSize(){ return mSize;}void Axis::SetSize(float size){ mSize = std::max<float>(0.1f,size);}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -