June 29, 2009

I WAS in LOVE with Adobe Director until 11.5

Made this with Director MX, republished with 11, runs well with 11. Until... and the project halted since the new player requires me to buy new version of Director. WTF!!! And they don't even support Shaders - at this time. And they are still buggy (please refer to Adobe Director forum)

It's not so great, but took me many hours of time and efforts..

Here's the screenshots one of my personal project (I'm not able to release client's project screenshots)

Opening screen.. procedural texture and models are generated here.

Orbiting the space.. showing Earth, Sun, Mars and some stars on the background.

Fly through the procedural generated landscape.. terrain and clouds (clouds are generated according to the terrain heights.

Water.. fake reflection, multi-texture waves

Finally, smoke and fire... burn the terrain with mouse (carve your wive's name or your mother in-law)

To get these screenshots I have to open through Director using .dir file. Director's .dcr and .exe won't work anymore.

That's about it. Life sucks!

June 28, 2009

2007 rendering with 3D Studio Max






I don't know what to tell about this project. Just smoke, glass, butts.. mm and some emitter..

Some Interrior 3D Rendering few months ago..






Some info in the image will remain hidden. :)

June 26, 2009

Abusing Blender 2.49a and Fix the Black/Dark 3D Objects

I've been discouraged on using Blender last few years because of my ATI glitches - black screen, blue screen, broken textures, weird texture, weird pattern, etc. Last few days, once again I tried to eliminate or at least minimize those random bugs during GLSL.

Until now I've been trying to replicate those glitches with my new tweak. There are no glitches anymore unless adding 2 or more lights (1 hemi and 1 spot still runs well for me)

Here's my tweak.. with ATI tray tools (I'm using ATI 9600xt)

[HKEY_CURRENT_USER\Software\Ray Adams\ATITrayTools\Profiles\d3d\myProfileMax]
"FlipQueueSize"="1"
"SwapEffect"="0"
"LODAdj"="0"
"ASTT"="1"
"ASD"="1"
"AreaAniso"="1"
"AntiAlias"="2"
"AntiAliasSamples"="6"
"AnisoType"="0"
"AnisoDegree"="16"
"TextureOpt"="0"
"TextureLod"="0"
"VSync"="1"
"TruformMode"="0"
"PixelCenter"="0"
"ExportCompressedTex"="1"
"ExportBumpMappedTex"="1"
"AnisotropyOptimise"="1"
"TrilinearOptimise"="1"
"CatalystAI"="1"
"GI"="1"
"ATMS"="2"
"TemporalAAMultiplier"="2"
"TemporalAAFrameThreshold"="0"
"EnableTripleBuffering"="1"
"ForceZBufferDepth"="0"
"OGLCustomSwapSourceFile"=""


That's what in my registry for ATI Tray Tools.

Update: 11 October 2009.

Enable the Temporal AA and Anisotropic AA to fix the black/dark objects.

Here's my xml Catalyst profile (for Catalyst - if not using ATI Tray tools)
This xml file located in:

C:\Documents and Settings\ [your name] \Local Settings\Application Data\ATI\ACE\Profiles

NOTE: I have 2 profiles. 1 with TAA and AAA and another without TAA and AAA. Why? Because with TAA and AAA, "Sculpting" and "Painting" won't work. Simply switching one profile to another will simplify my work. During sculpting and painting, I am not going to use GLSL.

<Profile> <Caste name="Graphics"> <Groups /> <Feature name="PanningMode"> <Property name="PanningMode_Control" value="At_Least_One_No_Panning" /> </Feature> <Feature name="DisplayDetection"> <Property name="DisplayDetection_Control" value="Manual" /> </Feature> <Feature name="Platform" /> <Adapter name= "PCI_VEN_1002&DEV_4152&SUBSYS_2096148C&REV_00_4&354AEA31&0&0008A"> <Feature name="Active"> <Property name="Active_Control" value="True" /> </Feature> <Feature name="Primary"> <Property name="Primary_Control" value="True" /> </Feature> <Feature name="Mode"> <Property name = "ModeInfo_Control" value = "Width:1152; Height:864; Bpp:32; RefreshRate:60; ModeFlag:0; Orientatio n:0; XPos:0; YPos:0;" /> </Feature> <Feature name = "MappingInfo"> <Property name = "MappingInfo_Control" value = "1stControllerDevice:0; 2ndControllerDevice:NIL; Manner(Single):0;" /> </Feature> <Feature name="CrossDisplay"> <Property name="XDMode_Control" value="MultipleAdapter" /> <Property name="DisplayAdapterIndex_Control" value="0" /> <Property name="RenderAdapterIndex_Control" value="0" /> </Feature> <Aspect name="DisplaysColour2"> <Feature name="ATIMode_3D"> <Property name="ATIMode_3D" value="True" /> </Feature> <Feature name="FullScreen3D"> <Property name ="FullScreen3D" value ="Gamma_Red:1; Gamma_Green:1; Gamma_Blue:1; Brightness_Red:0; Brightnes s_Green:0; Brightness_Blue:0; Contrast_Red:100; Contrast_Green:100; Contrast _Blue:100;" /> </Feature> <Feature name="ATIMode_Desktop"> <Property name="ATIMode_Desktop" value="True" /> </Feature> <Feature name="Desktop"> <Property name ="Desktop" value ="Gamma_Red:1; Gamma_Green:1; Gamma_Blue:1; Brightness_Red:0; Brightnes s_Green:0; Brightness_Blue:0; Contrast_Red:100; Contrast_Green:100; Contrast _Blue:100;" /> </Feature> <Feature name="LUT_Desktop"> <Property name="LUT_Desktop" value=" 0,0,0,257,257,257,514,514,514,771,771,771,1028,1028,1028, 1285,1285,1285,1542,1542,1542,1799,1799,1799,2056,2056,2056, 2313,2313,2313,2570,2570,2570,2827,2827,2827,3084,3084,3084, 3341,3341,3341,3598,3598,3598,3855,3855,3855,4112,4112,4112, 4369,4369,4369,4626,4626,4626,4883,4883,4883,5140,5140,5140, 5397,5397,5397,5654,5654,5654,5911,5911,5911,6168,6168,6168, 6425,6425,6425,6682,6682,6682,6939,6939,6939,7196,7196,7196, 7453,7453,7453,7710,7710,7710,7967,7967,7967,8224,8224,8224, 8481,8481,8481,8738,8738,8738,8995,8995,8995,9252,9252,9252, 9509,9509,9509,9766,9766,9766,10023,10023,10023,10280,10280, 10280,10537,10537,10537,10794,10794,10794,11051,11051,11051, 11308,11308,11308,11565,11565,11565,11822,11822,11822,12079, 12079,12079,12336,12336,12336,12593,12593,12593,12850,12850, 12850,13107,13107,13107,13364,13364,13364,13621,13621,13621, 13878,13878,13878,14135,14135,14135,14392,14392,14392,14649, 14649,14649,14906,14906,14906,15163,15163,15163,15420,15420, 15420,15677,15677,15677,15934,15934,15934,16191,16191,16191, 16448,16448,16448,16705,16705,16705,16962,16962,16962,17219, 17219,17219,17476,17476,17476,17733,17733,17733,17990,17990, 17990,18247,18247,18247,18504,18504,18504,18761,18761,18761, 19018,19018,19018,19275,19275,19275,19532,19532,19532,19789, 19789,19789,20046,20046,20046,20303,20303,20303,20560,20560, 20560,20817,20817,20817,21074,21074,21074,21331,21331,21331, 21588,21588,21588,21845,21845,21845,22102,22102,22102,22359, 22359,22359,22616,22616,22616,22873,22873,22873,23130,23130, 23130,23387,23387,23387,23644,23644,23644,23901,23901,23901, 24158,24158,24158,24415,24415,24415,24672,24672,24672,24929, 24929,24929,25186,25186,25186,25443,25443,25443,25700,25700, 25700,25957,25957,25957,26214,26214,26214,26471,26471,26471, 26728,26728,26728,26985,26985,26985,27242,27242,27242,27499, 27499,27499,27756,27756,27756,28013,28013,28013,28270,28270, 28270,28527,28527,28527,28784,28784,28784,29041,29041,29041, 29298,29298,29298,29555,29555,29555,29812,29812,29812,30069, 30069,30069,30326,30326,30326,30583,30583,30583,30840,30840, 30840,31097,31097,31097,31354,31354,31354,31611,31611,31611, 31868,31868,31868,32125,32125,32125,32382,32382,32382,32639, 32639,32639,32896,32896,32896,33153,33153,33153,33410,33410, 33410,33667,33667,33667,33924,33924,33924,34181,34181,34181, 34438,34438,34438,34695,34695,34695,34952,34952,34952,35209, 35209,35209,35466,35466,35466,35723,35723,35723,35980,35980, 35980,36237,36237,36237,36494,36494,36494,36751,36751,36751, 37008,37008,37008,37265,37265,37265,37522,37522,37522,37779, 37779,37779,38036,38036,38036,38293,38293,38293,38550,38550, 38550,38807,38807,38807,39064,39064,39064,39321,39321,39321, 39578,39578,39578,39835,39835,39835,40092,40092,40092,40349, 40349,40349,40606,40606,40606,40863,40863,40863,41120,41120, 41120,41377,41377,41377,41634,41634,41634,41891,41891,41891, 42148,42148,42148,42405,42405,42405,42662,42662,42662,42919, 42919,42919,43176,43176,43176,43433,43433,43433,43690,43690, 43690,43947,43947,43947,44204,44204,44204,44461,44461,44461, 44718,44718,44718,44975,44975,44975,45232,45232,45232,45489, 45489,45489,45746,45746,45746,46003,46003,46003,46260,46260, 46260,46517,46517,46517,46774,46774,46774,47031,47031,47031, 47288,47288,47288,47545,47545,47545,47802,47802,47802,48059, 48059,48059,48316,48316,48316,48573,48573,48573,48830,48830, 48830,49087,49087,49087,49344,49344,49344,49601,49601,49601, 49858,49858,49858,50115,50115,50115,50372,50372,50372,50629, 50629,50629,50886,50886,50886,51143,51143,51143,51400,51400, 51400,51657,51657,51657,51914,51914,51914,52171,52171,52171, 52428,52428,52428,52685,52685,52685,52942,52942,52942,53199, 53199,53199,53456,53456,53456,53713,53713,53713,53970,53970, 53970,54227,54227,54227,54484,54484,54484,54741,54741,54741, 54998,54998,54998,55255,55255,55255,55512,55512,55512,55769, 55769,55769,56026,56026,56026,56283,56283,56283,56540,56540, 56540,56797,56797,56797,57054,57054,57054,57311,57311,57311, 57568,57568,57568,57825,57825,57825,58082,58082,58082,58339, 58339,58339,58596,58596,58596,58853,58853,58853,59110,59110, 59110,59367,59367,59367,59624,59624,59624,59881,59881,59881, 60138,60138,60138,60395,60395,60395,60652,60652,60652,60909, 60909,60909,61166,61166,61166,61423,61423,61423,61680,61680, 61680,61937,61937,61937,62194,62194,62194,62451,62451,62451, 62708,62708,62708,62965,62965,62965,63222,63222,63222,63479, 63479,63479,63736,63736,63736,63993,63993,63993,64250,64250, 64250,64507,64507,64507,64764,64764,64764,65021,65021,65021, 65278,65278,65278,65535,65535,65535," /> </Feature> <Feature name="BlackAndWhite"> <Property name="BlackAndWhite_Control" value="0" /> </Feature> </Aspect> <Aspect name="DisplaysOptions"> <Feature name="3DRefreshRateOverride"> <Property name="RefreshRateOverride_Control" value="0;Disabled" /> </Feature> <Feature name="MouseTracksOrientation"> <Property name="MouseTracksOrientation_Control" value="True" /> </Feature> <Feature name="ForceTVDetection"> <Property name="ForceTVDetection_Control" value="False" /> </Feature> <Feature name="ForceCVDetection"> <Property name="ForceCVDetection_Control" value="False" /> </Feature> </Aspect> <Aspect name="VPURecover"> <Feature name="VPUEnableSubmissionBox"> <Property name="VPUEnableSubmissionBox_Control" value="Enable" /> </Feature> <Feature name="DisableSmartSave"> <Property name="DisableSmartSave_Control" value="Enable" /> </Feature> </Aspect> <Aspect name="Radeon3D"> <Feature name="Main3D"> <Property name="Main3D" value="CusSelection" /> </Feature> <Feature name="AntiAlias"> <Property name="AntiAlias" value="On" /> <Property name="AntiAliasSamples" value="2" /> </Feature> <Feature name="AnisoType"> <Property name="AnisoType" value="App" /> <Property name="AnisoDegree" value="0" /> <Property name="AreaAniso" value="Disable" /> </Feature> <Feature name="TextureLod"> <Property name="TextureLod" value="HiPerformance" /> </Feature> <Feature name="VSyncControl"> <Property name="VSyncControl" value="AppPerformance" /> </Feature> <Feature name="EnableTripleBuffering"> <Property name="EnableTripleBuffering" value="Enable" /> </Feature> <Feature name="TemporalAAMultiplier"> <Property name="TemporalAAMultiplier" value="Enable2" /> </Feature> <Feature name="CatalystAI"> <Property name="CatalystAI" value="Disable" /> </Feature> <Feature name="GI"> <Property name="GI" value="Enable" /> </Feature> <Feature name="ASTT"> <Property name="ASTT" value="Enable" /> <Property name="AdaptiveAAMethod" value="SuperSample" /> <Property name="ASD" value="Performance" /> <Property name="ATMS" value="Disabled" /> </Feature> <Feature name="AAF"> <Property name="AAF" value="" /> </Feature> <Feature name="DisplayCrossfireLogo"> <Property name="BooleanWriteableProperty" value="False" /> </Feature> <Feature name="ForceHigh3DClocks"> <Property name="ForceHigh3DClocks" value="Disable" /> </Feature> </Aspect> <Aspect name="MMVideo"> <Feature name="MainVideo"> <Property name="MainVideo" value="0" /> </Feature> <Feature name="VideoVision"> <Property name="VideoVision_brightness" value="0" /> <Property name="VideoVision_contrast" value="0" /> <Property name="VideoVision_saturation" value="0" /> <Property name="VideoVision_gamma" value="0" /> <Property name="VideoVision_hue" value="0" /> <Property name="VideoVision_appdecide" value="True" /> </Feature> <Feature name="TheaterMode"> <Property name="TheaterMode_DisplayMode" value="0" /> <Property name="TheaterMode_TheaterSettings" value="0" /> </Feature> <Feature name="Deinterlacing"> <Property name="Deinterlacing_Deinterlacing" value="0" /> <Property name="Deinterlacing_EnableDeinterlacing" value="True" /> </Feature> <Feature name="DXVA_WMV"> <Property name="DXVA_WMV" value="False" /> </Feature> <Feature name="3to2Pulldown"> <Property name="3to2Pulldown" value="False" /> </Feature> <Feature name="dynamicContrast"> <Property name="dynamicContrast" value="False" /> </Feature> <Feature name="Detail"> <Property name="Detail_Detail" value="0" /> <Property name="Detail_EnableDetail" value="False" /> </Feature> <Feature name="Denoise"> <Property name="Denoise_Denoise" value="0" /> <Property name="Denoise_EnableDenoise" value="False" /> </Feature> <Feature name="FleshTone"> <Property name="FleshTone_FleshTone" value="0" /> <Property name="FleshTone_EnableFleshTone" value="False" /> </Feature> <Feature name="ColorVibrance"> <Property name="ColorVibrance_ColorVibrance" value="0" /> <Property name="ColorVibrance_EnableColorVibrance" value="False" /> </Feature> </Aspect> </Adapter> <Adapter name= "PCI_VEN_1002&DEV_4172&SUBSYS_2097148C&REV_00_4&354AEA31&0&0108A"> <Feature name="Active"> <Property name="Active_Control" value="False" /> </Feature> <Feature name="Primary"> <Property name="Primary_Control" value="False" /> </Feature> <Feature name="Mode"> <Property name = "ModeInfo_Control" value = "Width:640; Height:480; Bpp:8; RefreshRate:60; ModeFlag:0; Orientation: 0; XPos:1024;YPos:0;" /> </Feature> <Feature name="MappingInfo"> <Property name ="MappingInfo_Control" value ="1stControllerDevice:NIL; 2ndControllerDevice:NIL; Manner(NotActive) :-1;" /> </Feature> <Feature name="CrossDisplay"> <Property name="XDMode_Control" value="MultipleAdapter" /> <Property name="DisplayAdapterIndex_Control" value="0" /> <Property name="RenderAdapterIndex_Control" value="0" /> </Feature> </Adapter> </Caste> </Profile>

Remake: F-15 100% Blender WIP


The previous F-15 Model are nice.. but.. build with tris not quads. I decided to remodel from scratch with 100% blender... and of course aimed for real-time.

The new version fixes..
  1. normals
  2. quads!
  3. easy and nicer progressive meshes implementation
  4. unlimited high detail smooth model
  5. shaders!
  6. real-time reflection
  7. real-time mirror
  8. reat-time shadow
More images coming... - If I'm not lazy..

June 15, 2009

Custom 3D Loader and Viewer

10 OCT 2015. NOTE: This is too old - outdated code. (The concept of retrieving/loading data/vertex still can be use)
OpenGL 3D object loader in action!

Made this on somewhere around 2007 - on my other site. Posting the source code here..

// 3D Viewer for Ababil // Created by MZIskandar 2007 #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> #include <GL/gl.h> #include <GL/glu.h> #include <GL/glext.h> #include <time.h> #include "3DData.h" // Windows globals, defines, and prototypes char szAppName[] = "3D Viewer"; HWND ghWnd; HDC ghDC; HGLRC ghRC; #define SWAPBUFFERS SwapBuffers(ghDC) #define WIDTH 640 #define HEIGHT 320 LONG WINAPI MainWndProc (HWND, UINT, WPARAM, LPARAM); BOOL bSetupPixelFormat(HDC); // OpenGL globals, defines, and prototypes float aspect = (float)WIDTH / (float)HEIGHT; float zNear = 1.0f; float zFar = 1024.0f; float TWOPI_OVER_360 = (2*M_PI)/360.0f; GLfloat SpinX = 0.0f; GLfloat SpinY = 0.0f; GLfloat Zoom = -50.0f; GLvoid resize(GLsizei, GLsizei); GLvoid initializeGL(GLsizei, GLsizei); GLvoid drawScene(GLvoid); PFNGLGENBUFFERSPROC glGenBuffers = NULL; PFNGLBINDBUFFERPROC glBindBuffer = NULL; PFNGLBUFFERDATAPROC glBufferData = NULL; PFNGLDELETEBUFFERSPROC glDeleteBuffers = NULL; GLuint vertexBuffer = 0; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG msg; WNDCLASS wndclass; // Register the frame class wndclass.style = 0; wndclass.lpfnWndProc = (WNDPROC)MainWndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hInstance; wndclass.hIcon = LoadIcon(hInstance, szAppName); wndclass.hCursor = LoadCursor(NULL,IDC_ARROW); wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wndclass.lpszMenuName = szAppName; wndclass.lpszClassName = szAppName; if (!RegisterClass(&wndclass)) return FALSE; // Create the frame ghWnd = CreateWindow ( szAppName, "3D Viewer for Ababil", WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, WIDTH, HEIGHT, NULL, NULL, hInstance, NULL ); // Make sure window was created if (!ghWnd) return FALSE; // Show and update main window ShowWindow(ghWnd, nCmdShow); UpdateWindow(ghWnd); // Animation loop while (1) { while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) == TRUE) { if (GetMessage(&msg, NULL, 0, 0) ) { TranslateMessage(&msg); DispatchMessage(&msg); } else { return TRUE; } } drawScene(); } } // Main window procedure LONG WINAPI MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static POINT ptLastMousePosit; static POINT ptCurrentMousePosit; static int bLMousing, bRMousing; LONG lRet = 1; RECT rect; switch (uMsg) { case WM_CREATE: { ghDC = GetDC(hWnd); if(!bSetupPixelFormat(ghDC)) PostQuitMessage (0); ghRC = wglCreateContext(ghDC); wglMakeCurrent(ghDC, ghRC); GetClientRect(hWnd, &rect); initializeGL(rect.right, rect.bottom); break; } case WM_PAINT: { drawScene(); static int frames; static clock_t oldTime; static float rate; frames++; if (frames >= 100) { clock_t newTime = clock(); // Optimizing.. // rate = 100.0f / ((newTime - oldTime) / 1000.0); rate = frames / ((newTime - oldTime) * 0.001); oldTime = newTime; char buffer[64]; sprintf(buffer, "3D Viewer for Ababil [mziskandar@yahoo.com] FPS: %3.2f", rate); SetWindowText(hWnd, buffer); frames = 0; } break; } case WM_SIZE: { GetClientRect(hWnd, &rect); resize(rect.right, rect.bottom); break; } case WM_CLOSE: { if (ghRC) wglDeleteContext(ghRC); if (ghDC) ReleaseDC(hWnd, ghDC); ghRC = 0; ghDC = 0; DestroyWindow(hWnd); break; } case WM_DESTROY: { if (ghRC) wglDeleteContext(ghRC); if (ghDC) ReleaseDC(hWnd, ghDC); glDeleteBuffers(1, &vertexBuffer); PostQuitMessage (0); break; } case WM_KEYDOWN: { switch( wParam ) case VK_ESCAPE: PostQuitMessage(0); break; break; } case WM_LBUTTONDOWN: { ptLastMousePosit.x = ptCurrentMousePosit.x = LOWORD(lParam); ptLastMousePosit.y = ptCurrentMousePosit.y = HIWORD(lParam); bLMousing = 1; break; } case WM_LBUTTONUP: { bLMousing = 0; break; } case WM_RBUTTONDOWN: { ptLastMousePosit.x = ptCurrentMousePosit.x = LOWORD(lParam); ptLastMousePosit.y = ptCurrentMousePosit.y = HIWORD(lParam); bRMousing = 1; break; } case WM_RBUTTONUP: { bRMousing = 0; break; } case WM_MOUSEMOVE: { ptCurrentMousePosit.x = LOWORD(lParam); ptCurrentMousePosit.y = HIWORD(lParam); if(bLMousing) { SpinX -= (ptCurrentMousePosit.x-ptLastMousePosit.x); SpinY -= (ptCurrentMousePosit.y-ptLastMousePosit.y); } if(bRMousing) { Zoom -= (ptCurrentMousePosit.y-ptLastMousePosit.y); } ptLastMousePosit = ptCurrentMousePosit; break; } default: { lRet = (LONG)DefWindowProc(hWnd, uMsg, wParam, lParam); break; } } return lRet; } BOOL bSetupPixelFormat(HDC hdc) { PIXELFORMATDESCRIPTOR pfd, *ppfd; int pixelformat; ppfd = &pfd; ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR); ppfd->nVersion = 1; ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; ppfd->dwLayerMask = PFD_MAIN_PLANE; ppfd->iPixelType = PFD_TYPE_COLORINDEX; ppfd->cColorBits = 16; ppfd->cDepthBits = 16; ppfd->cAccumBits = 0; ppfd->cStencilBits = 0; pixelformat = ChoosePixelFormat(hdc, ppfd); if((pixelformat = ChoosePixelFormat(hdc, ppfd)) == 0) { MessageBox(NULL,"ChoosePixelFormat failed", "Error",MB_OK); return FALSE; } if(SetPixelFormat(hdc, pixelformat, ppfd) == FALSE) { MessageBox(NULL,"SetPixelFormat failed", "Error", MB_OK); return FALSE; } return TRUE; } // OpenGL code // ----------- GLvoid resize(GLsizei width, GLsizei height) { glViewport( 0, 0, width, height ); aspect = ((GLfloat) width / (GLfloat) height); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); GLdouble half_height = zNear * tan( 60.0 * 0.5 * TWOPI_OVER_360 ); GLdouble half_width = half_height * aspect; glFrustum( -half_width, half_width, -half_height, half_height, zNear, zFar ); glMatrixMode(GL_MODELVIEW); } GLvoid createObjects() { glBindBuffer = (PFNGLBINDBUFFERPROC)wglGetProcAddress("glBindBuffer"); glGenBuffers = (PFNGLGENBUFFERSPROC)wglGetProcAddress("glGenBuffers"); glBufferData = (PFNGLBUFFERDATAPROC)wglGetProcAddress("glBufferData"); glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)wglGetProcAddress("glDeleteBuffers"); glGenBuffers(1, &vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); // Release buffer after usage. // --------------------------- glVertexPointer(3, GL_FLOAT, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); } GLvoid initializeGL(GLsizei width, GLsizei height) { glEnable(GL_DEPTH_TEST); glPolygonOffset(1.0, 1.0); glClearColor(0.0, 0.0, 0.0, 0.0); glDisable(GL_NORMALIZE); glEnable(GL_CULL_FACE); resize(WIDTH, HEIGHT); createObjects(); } GLvoid drawScene(GLvoid) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef( 0.0, 0.0, Zoom ); glRotatef( -SpinY*0.2, 1.0, 0.0, 0.0 ); glRotatef( -SpinX*0.2, 0.0, 1.0, 0.0 ); glEnableClientState(GL_VERTEX_ARRAY); // Hidden line remover // ------------------- glColor3f(0.0,0.0,0.0); glPolygonMode(GL_FRONT, GL_FILL); glEnable(GL_POLYGON_OFFSET_FILL); glDrawArrays(GL_TRIANGLES, 0, 25128); glDisable(GL_POLYGON_OFFSET_FILL); glColor3f(1.0,1.0,1.0); glPolygonMode(GL_FRONT, GL_LINE); glDrawArrays(GL_TRIANGLES, 0, 25128); glDisableClientState(GL_VERTEX_ARRAY); SWAPBUFFERS; }




With pre-baked rendered textures.

The "3DData.h" containing..

const float vertices[]={ -2.4000f,2.5907f,11.0000f,-1.2972f,2.3958f,11.0000f,-1.3320f,2.3501f,9.0000f, ... and so on .. ... and so on .. };



Its and array containing 3D objects vertices from .obj files. The later version with textures.. I lost the codes.. looks like this. Now I'm trying to port to OpenGL 3.