線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:968
推到 Plurk!
推到 Facebook!

請問有關openGL 三角網格的問題

尚未結案
3358
一般會員


發表:4
回覆:0
積分:0
註冊:2005-09-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-09-24 23:57:38 IP:140.116.xxx.xxx 未訂閱
我在程式compile出了一點問題 應該是函式宣告的問題 有沒有哪位高人可以指點一下我到底是哪裡錯ㄌ,程式碼如下 --------------------Configuration: HW1-1 - Win32 Debug--------------- ----- Compiling... HW1-1.cpp Linking... HW1-1.obj : error LNK2001: unresolved external symbol "struct STriangle * __cdecl LoadStlASCII(char const *,int &)" (?LoadStlASCII@@YAPAUSTriangle@@PBDAAH@Z) Debug/HW1-1.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.    HW1-1.exe - 2 error(s), 0 warning(s) #include  #include #include #include #include "inputStl.h" // Rotation amounts static GLfloat xRot = 0.0f; static GLfloat yRot = 0.0f; //triangles STriangle * triArray = NULL; int nTriangles = 0; // Called to draw scene void RenderScene() { // Clear the window glClear(GL_COLOR_BUFFER_BIT); // Save matrix state and do the rotation glPushMatrix(); glRotatef(xRot, 1.0f, 0.0f, 0.0f); glRotatef(yRot, 0.0f, 1.0f, 0.0f); for (int i=0; i 356.0f) xRot = 0.0f; if(xRot < -1.0f) xRot = 355.0f; if(yRot > 356.0f) yRot = 0.0f; if(yRot < -1.0f) yRot = 355.0f; // Refresh the Window glutPostRedisplay(); } void ChangeSize(int w, int h) { //GLfloat nRange = 1.9f; GLfloat nRange = 500.0f; // Prevent a divide by zero if(h == 0) h = 1; // Set Viewport to window dimensions glViewport(0, 0, w, h); // Reset projection matrix stack glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Establish clipping volume (left, right, bottom, top, near, far) if (w <= h) glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange*100, nRange*100); else glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange*100, nRange*100); // Reset Model view matrix stack glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void main() { triArray = LoadStlASCII("Sammy1_ascii.stl", nTriangles); //triArray = LoadStlBinary("Sammy1_binary.stl", nTriangles); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutCreateWindow("STL Loading Sample"); glutReshapeFunc(ChangeSize); glutSpecialFunc(SpecialKeys); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); }
RedSnow
版主


發表:79
回覆:1322
積分:845
註冊:2003-12-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-09-25 18:54:26 IP:61.217.xxx.xxx 未訂閱
3358 您好:    以下事項請您配合:    1. 請勿一文多發,您已經違反版規共在四個不同討論區發出與本篇相同的問題,重覆的另外三篇稍後將會刪除,請您詳閱版規並惠予配合: 【公告】Delphi K.Top討論區守則(版規) http://delphi.ktop.com.tw/topic.php?TOPIC_ID=18707 【公告】新手需知---本站使用說明 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=19264 2. 請注意程式碼的縮排整理並參考下列連結頁面內的說明,然後透過 "修改文章" 的功能重新張貼您的程式碼,以便他人瀏覽: 【公告】程式碼張貼規則與方法 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=57538 【公告】重申版規與作業問題說明 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=58991 7 天天敲鍵盤 v 時時按滑鼠 8
系統時間:2024-05-18 7:18:38
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!