Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (2)
OpenGL MUST Project 1[Polyline Editor] use Array o
no vote
// student name: // student ID: // date: /*#include "D:HomeworkOpenGLFinalCGLabGLUT_Toolkitglut.h"*/ #include <stdlib.h> #include <stdio.h> #include <math.h> GLint ploypoint = 0; GLint ployline=-1; GLint height; GLint choose=0; GLint move_ployline,move_ploypoint; struct Point { int x; int y; }; struct GLintPointArray { Point point[60]; }; GLintPointArray ploy[60]; void drawPointLine() { for (int i=0;i<=ployline;i++) { glBegin(GL_LINE_STRIP); for(int k=0;k<60;k++) { if (ploy[i].point[k].x!=0&&ploy[i].point[k].y!=0) glVertex2i(ploy[i].point[k].x,ploy[i].point[k].y); } glEnd(); } } void Mouse(int button, int state, int x, int y) { Point temp; if (state==G
myteat
2016-08-23
0
1
OpenGL MUST Project 1[Polyline Editor] use linked
no vote
#include <D:HomeworkOpenGLProject1GLUT 3.7glut.h> #include <stdlib.h> #include <stdio.h> #include <math.h> #include "point.h" /*draw line from the line array*/ void drawPointLine() { Node * temp; for (int i=0;i<Arraysize;i++) { temp=polylineArray[i]; glBegin(GL_LINE_STRIP); while (temp->next!=NULL) { temp=temp->next; glVertex2i(temp->x,temp->y); } glEnd(); } } /*find the point and delete the point from the line array*/ void delpointFun(int xx,int yy) { for (int i=0;i<Arraysize;i++) { delpoint=polylineArray[i]; while (delpoint->next!=NULL) { int del_x=delpoint->next->x-xx; int del_y=delpoint->next->y-yy; if((del_x < 5 && del_x > -5)&&(del_y < 5 && del_y > -
myteat
2016-08-23
0
1
No more~