Курсовой проект 106 страниц, 42 рисунка, 2 таблицы, 18 фомул, 15 матриц, 4 приложения
Скачать 5.65 Mb.
|
gluDisk(q, 0, 1, 3, 1); glPopMatrix(); glPopMatrix(); glPushMatrix(); glRotated(210,0,1,0); glPushMatrix(); glTranslatef(0, 0, 20); glRotated(90,1,0,0); gluCylinder(q, 1, 2, 2, 3, 1); gluDisk(q, 0, 1, 3, 1); glPopMatrix(); glPopMatrix(); gluDeleteQuadric(q); glShadeModel(GL_SMOOTH); } class KOSPR: public OBJECT3D //кос призма { public: KOSPR(float x, float y, float z, float r=1., float g=1., float b=1., float a=1): OBJECT3D(x, y, z, r, g, b, a){ settings.n=1; settings.m=1;} void Draw(); }; void KOSPR::Draw() { if(!settings.visible) return; OBJECT3D::Draw(); GLUquadricObj* q=gluNewQuadric(); glPushMatrix(); GLfloat M1[]={1,0.1,0.1,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; GLfloat M2[]={1,-0.1,-0.1,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; glPushMatrix(); glMultMatrixf(M1); glRotated(30,0,1,0); glTranslatef(0*x, 0*y, 18*z); glPushMatrix(); glRotated(45,0,1,0); gluCylinder(q, 1.5*x, 1.5*y, 4*z , 3, 1); glPushMatrix(); glTranslatef(0, 0, 4*z); gluDisk(q, 0, 1.5*y, 3*z, 1); glPopMatrix(); glPopMatrix(); glPopMatrix(); glPushMatrix(); glMultMatrixf(M1); glRotated(30,0,1,0); glTranslatef(0, 0, 18*z); glPushMatrix(); glRotated(-45,0,1,0); gluCylinder(q, 1.5*x, 1.5*y, 4*z , 3, 1); glPushMatrix(); glTranslatef(0, 0, 4*z); gluDisk(q, 0, 1.5*y, 3, 1); glPopMatrix(); glPopMatrix(); glPopMatrix(); /////////////////////////////////////////////////// glPushMatrix(); glMultMatrixf(M2); glRotated(-30,0,1,0); glTranslatef(0, 0, 18*z); glPushMatrix(); glRotated(45,0,1,0); gluCylinder(q, 1.5*x, 1.5*y, 4 , 3, 1); glPushMatrix(); glTranslatef(0, 0, 4*z); gluDisk(q, 0, 1.5*y, 3, 1); glPopMatrix(); glPopMatrix(); glPopMatrix(); glPushMatrix(); glMultMatrixf(M2); glRotated(-30,0,1,0); glTranslatef(0, 0, 18*z); glPushMatrix(); glRotated(-45,0,1,0); gluCylinder(q, 1.5*x, 1.5*y, 4 , 3, 1); glPushMatrix(); glTranslatef(0, 0, 4); gluDisk(q, 0, 1.5*y, 3, 1); glPopMatrix(); glPopMatrix(); glPopMatrix(); glPopMatrix(); gluDeleteQuadric(q); glShadeModel(GL_SMOOTH); } #endif ______resours___________ //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by rs.rc // #define IDD_PARAMS 112 #define IDD_PRIMITIVES_PARAMS 112 #define IDD_CAMERA_PARAMS 114 #define IDD_LIGHTS_PARAMS 115 #define IDD_SCENE_PARAMS 116 #define IDD_AFF_AJ 117 #define IDI_ICON1 119 #define IDC_BUTTON1 1008 #define IDC_CAM_SET 1008 #define IDC_SCENE_SAVE 1008 #define IDC_OBJ_DEL 1008 #define IDC_AFF_DO 1008 #define IDC_AJ_DO 1008 #define IDC_SAVESCENE 1008 #define IDC_COMBO1 1009 #define IDC_SCENE_LOAD 1009 #define IDC_LIGHTS 1009 #define IDC_OBJ_ADD 1009 #define IDC_AJ_NAME 1009 #define IDC_LOADSCENE 1009 #define IDC_EDIT1 1010 #define IDC_BUTTON2 1010 #define IDC_LIGHT_POSY 1010 #define IDC_OBJ_FIND 1010 #define IDC_SCENE_CLEAR 1010 #define IDC_PAR1 1010 #define IDC_EDIT2 1011 #define IDC_RADIO1 1011 #define IDC_SOLID 1011 #define IDC_LIGHT_POSX 1011 #define IDC_PAR2 1011 #define IDC_HEIGHT 1011 #define IDC_EDIT3 1012 #define IDC_RADIO2 1012 #define IDC_WIRE 1012 #define IDC_LIGHT_POSZ 1012 #define IDC_PAR3 1012 #define IDC_EDIT4 1013 #define IDC_EDIT5 1014 #define IDC_EDIT6 1015 #define IDC_EDIT7 1016 #define IDC_LIGHT_COLORG 1016 #define IDC_EDIT8 1017 #define IDC_LIGHT_COLORR 1017 #define IDC_EDIT9 1018 #define IDC_LIGHT_COLORB 1018 #define IDC_LIGHT_COLOR_GET 1021 #define IDC_SETPRIMCOLOR 1022 #define IDC_HPARTS 1023 #define IDC_WPARTS 1024 #define IDC_OBJECTS_LIST 1025 #define IDC_CAM_POSX 1026 #define IDC_OBJ_MATERIAL 1026 #define IDC_CAM_POSY 1027 #define IDC_CAM_POSZ 1028 #define IDC_CAM_DIRX 1029 #define IDC_CAM_DIRY 1030 #define IDC_CAM_DIRZ 1031 #define IDC_LIGHT_ON 1032 #define IDC_LIGHT_SET 1033 #define IDC_AFF_AJ 1034 #define IDC_OBJ_COLORR 1035 #define IDC_OBJ_COLORG 1036 #define IDC_OBJ_COLORB 1037 #define IDC_FPS 1038 #define IDC_LIGHTS_COUNT 1039 #define IDC_RENDER_TIME 1040 #define IDC_PAR1_NAME 1041 #define IDC_PAR2_NAME 1042 #define IDC_PAR3_NAME 1043 #define IDC_AF_AJ_HELP 1044 #define IDC_REFL_OXZ 1045 #define IDC_REFL_OYZ 1046 #define IDC_REFL_OXY 1047 #define IDC_REFL_O 1048 #define IDC_AJ_RESET 1049 #define IDC_AJ_RESET2 1050 #define IDC_AJ_RESET_PREV 1050 #define IDC_BUTTON3 1050 #define IDC_PRIM_HELP 1050 #define IDC_LMT_POINT 1052 #define IDC_OBJ_MODEL 1052 #define IDC_LMT_REMOTE 1053 #define IDC_DRAW_AXES 1053 #define IDC_LMT_CYL 1054 #define IDC_AXESALWAYSONTOP 1054 #define ID_MENUITEM40001 40001 #define ID_SP_COLOR 40005 #define ID_PIR3_SOLID 40006 #define ID_PIR4_WIRE 40007 #define ID_PIR3_WIRE 40007 #define ID_PIR3_COLOR 40008 #define ID_SP_SOLID 40010 #define ID_SP_WIRE 40011 #define ID_HSP_COLOR 40012 #define ID_HSP_SOLID 40013 #define ID_HSP_WIRE 40014 #define ID_CUBE_COLOR 40015 #define ID_CUBE_SOLID 40016 #define ID_CUBE_WIRE 40017 #define ID_PRISM3_SOLID 40018 #define ID_PRISM3_WIRE 40019 #define ID_PRISM3_COLOR 40020 #define ID_ELIPS_COLOR 40021 #define ID_ELIPS_SOLID 40022 #define ID_ELIPS_WIRE 40023 #define ID_CYL_COLOR 40024 #define ID_CYL_SOLID 40025 #define ID_CYL_WIRE 40026 #define ID_CAM_POS 40027 #define ID_CAM_DIR 40028 #define ID_MENUITEM40029 40029 #define ID_MENUITEM40030 40030 #define ID_MENUITEM40031 40031 #define ID_ABOUT 40031 #define ID_MENUITEM40032 40032 #define ID_AUTOR 40032 #define ID_SAVESCENE 40033 #define ID_LOADSCENE 40034 #define IDC_LIGHT0 40035 #define IDC_LIGHT1 40036 #define IDC_LIGHT2 40037 #define IDC_LIGHT3 40038 #define IDC_LIGHT4 40039 #define IDC_LIGHT5 40040 #define IDC_LIGHT6 40041 #define IDC_LIGHT7 40042 #define ID_HELP_CONTENT 40043 #define ID_CLEARSCENE 40044 #define ID_KOSPR_COLOR 40045 #define ID_SP_MAT_DIFF 40047 #define ID_SP_MAT_SPEC 40048 #define ID_HSP_MAT_DIFF 40049 #define ID_HSP_MAT_SPEC 40050 #define ID_CUBE_MAT_DIFF 40051 #define ID_CUBE_MAT_SPEC 40052 #define ID_PRISM3_MAT_DIFF 40053 #define ID_PRISM3_MAT_SPEC 40054 #define ID_ELIPS_MAT_DIFF 40055 #define ID_ELIPS_MAT_SPEC 40056 #define ID_CYL_MAT_DIFF 40057 #define ID_CYL_MAT_SPEC 40058 #define ID_PIR3_MAT_DIFF 40059 #define ID_PIR3_MAT_SPEC 40060 #define ID_KOSPR_SOLID 40061 #define ID_KOSPR_WIRE 40062 #define ID_KOSPR_MAT_DIFF 40063 #define ID_KOSPR_MAT_SPEC 40064 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 130 #define _APS_NEXT_COMMAND_VALUE 40065 #define _APS_NEXT_CONTROL_VALUE 1055 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif __________tip_wnd__________ #ifndef TIPWND_ #define TIPWND_ #include "globals.h" #include #define max(x, y) (((x)>(y))?(x):(y)) HWND hWnd; char *Text; HFONT hFont; RECT rct; class TIPWND { static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; char wt[100]; HDC hDC; switch(msg) { case WM_ACTIVATE: if(LOWORD(wParam)==WA_INACTIVE) DestroyWindow(hWnd); break; case WM_LBUTTONDOWN: DestroyWindow(hWnd); break; case WM_PAINT: hDC=BeginPaint(hWnd, &ps); GetWindowText(hWnd, wt, 99); SetBkMode(hDC, TRANSPARENT); TextOut(hDC, 7, 6, wt, strlen(wt)); SelectObject(hDC, hFont); DrawText(hDC, Text, strlen(Text), &rct, TA_LEFT|DT_EXPANDTABS); EndPaint(hWnd, &ps); break; case WM_TIMER: DestroyWindow(hWnd); break; } return DefWindowProc(hWnd, msg, wParam, lParam); } public: static void ShowNotification(int x, int y, char *caption, char *text, int type=0, int time=0) { ShowHelp(x, y, caption, text); SetTimer(hWnd, 0, time, 0); } TIPWND(){} static void ShowHelp(int x, int y, char *caption, char *text, HBITMAP hBmp=NULL) { WNDCLASS wcl; memset(&wcl, 0, sizeof(wcl)); wcl.hbrBackground=CreateSolidBrush(RGB(100, 200, 0)); wcl.hCursor=LoadCursor(NULL, IDC_ARROW); wcl.hInstance=hInst; wcl.lpfnWndProc=WndProc; wcl.lpszClassName="tip_wnd"; RegisterClass(&wcl); int w=290, h=140; hWnd=CreateWindow("tip_wnd", caption, WS_CHILD|WS_POPUP, x-w, y, w, h, hWndMain, 0, hInst, 0); HDC hDC=GetDC(hWnd); LOGFONT lf; memset(&lf, 0, sizeof(lf)); lf.lfCharSet=ANSI_CHARSET; lf.lfHeight=13; lf.lfQuality=PROOF_QUALITY; hFont=CreateFontIndirect(&lf); RECT captr; captr.left=10; captr.top=25; DrawText(hDC, caption, strlen(caption), &captr, DT_CALCRECT); SelectObject(hDC, hFont); rct.left=10; rct.top=25; DrawText(hDC, text, strlen(text), &rct, DT_CALCRECT); w=max(rct.right-rct.left+20, captr.right-captr.left+20); h=rct.bottom-rct.top+35; MoveWindow(hWnd, x-w, y, w, h, true); HRGN hRgn=CreateRoundRectRgn(5, 5, w-5, h-5, 10, 10); SetWindowRgn(hWnd, hRgn, true); ShowWindow(hWnd, SW_SHOW); Text=strdup(text); } }; #endif |