Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

133 Neutral

About Mathimetric

  • Rank

Personal Information

  1. Mathimetric

    Random Terrain Generation

    C++ coded terrain generator outputs 3d OBJ files readable and inportable to most 3d graphic editors (CAD)
  2. @ Moudy I can try to find a source for this example (a HEllo World example) but it will be un-related to the Hex editor -converter dipicted in the screen shot.   if thats ok? ; I will attach it to this messge when I have it together.     here is an alternate example of  GetString using OpenGL and windows library -So in function the *strng is updated (represinting a Line) via the stream buffer gBuff [ ] -when the return key check (rtrn) is  (>) greater then (Order) ; the function returns the string length of *strng - and stops updating the *strng   the reason it looks this way is because it is meant to be inserted into a windows Loop or Application window Loop. functions that are inside a window are a little different then the normal console apps' sometimes.   -class interface design- class GLText public:     int BuffPos, sBuffPos,     First, Count1, Count2;     unsigned int base;     unsigned int m_fontListBase;     GLYPHMETRICSFLOAT gmf[256];   // holds orientation and placement                                   // info for display lists      GLText();     ~GLText();     bool Init(char *fontname, int fontsize, float depth);     unsigned int CreateOutlineFont(char *fontname, int fontsize, float depth);     void PositionFont(float xPos, float yPos, float zPos);     void PrintFont(int order, const char *__format, ...);     void CenterFont();     void ReleaseFont(unsigned int base);     int  ScanFont(int order, const char *__format, ...);     void NewLine(float Mult = 1, float X = 0, float Y = 0, float Z = 0, char *Direction = "down");     bool Shutdown();     void Return0(void *var, char *type, int elms); //same as memset (...) for string     int  GetString(int Order, char *strng);     int rtrn;     char *pBuff;     char *sBuff;     char *gBuff;     char text[256]; int GLText::GetString(int Order, char *strng) { if(Order<=rtrn) { if (Order == rtrn ) {  glPushAttrib(GL_LIST_BIT);         glListBase(base);         glCallLists(strlen(gBuff), GL_UNSIGNED_BYTE, gBuff);  glPopAttrib();         strng[BuffPos] = gBuff[BuffPos];         strcpy(strng, gBuff); return 0; } else if(Order <= rtrn) {         glPushAttrib(GL_LIST_BIT);         glListBase(base);         glCallLists(strlen(strng), GL_UNSIGNED_BYTE, strng);  glPopAttrib(); return strlen(strng); } return 0; } else return strlen(strng); } I attached the class function def source code in src.cpp.txt you will need to use your knowledge of C++ to piece them together for compilation/debugging/porting or use in another instance.   You can do 1 of 2 things with it 1. you could just include (src.cpp) it to the appended end of the class body Def? 2. precompile it and link it with the H and the Main.cpp with the OBJ file (this also includes letting microsofts visual studio LInk the resources with (h/cpp))   Summary: this class will allow you, if you are using openGL (v1.0 or greater) 3d perspectives or ortho (ithink), a pixel pallete window application (WIN32); To draw 3d text on to the screen. Givin also the interface' to use input/output UI via keyboard or simulair (drivin) hardware. --another requirement is that the window(x/s) APP must have a procedure for handling the window and its messeges--   your skill level needs to be intermediate to advanced to understand how to compile or port this into your own apps. creating a window App is not an easy task for the beginner. You need to understand your own compiler and interfaces, and some compiler's dont always have the nessesary DLL's included in its default libraies; so sometimes you need to know how to find them and import them.
  3. Mathimetric


    Prodject Buggy Race; Dev Beta video
  4. Mathimetric

    my engine my rules

    compiled pics from open gl engine design('s) using c++, and anim8or (vtx ,obj ) files.
  5. Mathimetric

    Build UI in OpenGL for my 3D game world?

    Just so you understand that Mouse coord' system only uses 2 deminsions X,Y the coord starts from the Top zero and the left zero (going top to  (<, greater) down, and left to  (<, greater) right) You dont need to use Ortho graphic projection to use a 2d (or 3D) GUI.   the default OpenGL matrix is 4 x 4 units, if you do that math and a little guessing or debugging, it is simple enough to match your mouse Position checks with your Cursor and buttons.   when the screen position or size is changed   code: //inside MainWindowProc  (these are your handles for your window and GUI) //(windows messege SIZE) //(windows messege MOVE)   // dispatch messages  switch (uMsg) { //...   case WM_SIZE:   height = HIWORD(lParam);  // retrieve width and height   width = LOWORD(lParam); // ~(update mouse coords' center "relative")~ //   case WM_MOVE: //~(update new mouse postions relative to new RECT screen position)~// // Mouse_.GetRectPos(windowRect); //   Example thumb PIC (JPEG) [attachment=19265:ex1.JPG]
  6. Mathimetric

    Pong Buster

  7. Mathimetric

    Ships Captain

    Dice Game renders of S.C.Crew
  8. Mathimetric

    Atari's TOEE MOD Journal

    video game mod journal
  9. quik simple example inside  ~ MainWindowProc ~ (I have used this to print 3D text from user keyboard input)     [attachment=19238:example.JPG]     //                                                                  //     case WM_CHAR:     switch(wParam)     {     case VK_BACK:     if(print.BuffPos)     print.text[--print.BuffPos] = 0;     if(print.sBuffPos)     print.gBuff[--print.sBuffPos] = 0;     break;     case VK_RETURN:     print.text[++print.BuffPos] = NULL;     print.gBuff[++print.sBuffPos] = NULL;     print.Return0(print.text,"char", 256);     print.BuffPos = 0;     print.Return0(print.gBuff, "char", 256);     print.sBuffPos = 0;     ++print.rtrn;     break;  case VK_NEXT:  //MoonT.translation[1] -= 2;  break;  case VK_PRIOR:  //MoonT.translation[1] += 2;  break;  break;  break;    case VK_LEFT:         break;    case VK_RIGHT:       break;  case VK_DOWN:       break;    case VK_UP:        break;     default:     print.text[print.BuffPos] = (TCHAR) wParam;     print.gBuff[print.sBuffPos] = (TCHAR) wParam;     ++print.BuffPos;    ++print.sBuffPos;     break;     }     break; //                                                                    // ////////////////////////////////////////////////////////////////////////   Notice when a key is entered (printable character) the switch is defaulted to update a string buffer. --when enter key is depressed the handle Ends buffer with a NULL terminate char |- then updates the data "rtrn" member to allow the program to know what line or how many times the return key has been pressed. - this info is passed to the graphics functions for render()   -when the backspace key is pressed the string buffer's current Position is  zero'ed , and decrimented (pos) to re-enter the key that needs to be edited.     *in this case the buffer is used simulair to an I/O stream buffer in witch the buffer can be used to pass data to parameter's givin to a function or class member function; such as GetString(int Rtn_order, char * format, ...)   Original standard streaming I/O buffers uses access of the Keyboard buffer and passes its data to a TEMP file buffer { (I.E.)   extern  FILE        _RTLENTRY _EXPDATA _streams[]; extern  unsigned    _RTLENTRY _EXPDATA _nfile;   stdin   (&_streams[0]) stdout  (&_streams[1]) stderr  (&_streams[2]) } and C string Buffer's using BIOS (basic input/output instruction Sets')
  10. Mathimetric

    Build UI in OpenGL for my 3D game world?

    *with mouse driver: you can draw your interface using photo shop, *add animated buttons, similair to a web page design (hover, click ; textures), then interact with your GUI using Test POS XY relative to screen pos (if not full screen) and by checking if your mouse button is down or up. Then you have to support those handles for your buttons; what will they do when clicked, or hovered over?.   example is coded using c/C++ (oop/structured) //FILE MouseClass.h // //windows mouse driver //using windows library //handles are usually updated via win main Loop, and passed data to windows handle   #include <windows.h> #include <winuser.h> #include <windef.h> //simple example for winmouse class //for using the windows mouse //POINT  members { long x,y } class WinMouse { private: POINT CP;  //cursor position public: HWND windH; RECT RectA; long x, y; long cx,cy; int button1, button2; WinMouse(); ~WinMouse(); long CalcWindowX(); long CalcWindowY(); void ResetPos(long, long); void GetRectPos(RECT ); void GetPos(); void SetPos(long x,long y); void SetCenter(); void GetCenter(); void UpdateWindowCenter(); long GetX(); long GetY(); PosTest(int x, int y, int tx, int ty); //note needed for relative mouse pos //rect->left - GetX() , rect->top - GetY() //GetWindowRect(HWND,RECT IN PTR) //then Call //this->GetRectPos(RECT ); }; ////////////////////function definitions///////////////////// WinMouse::WinMouse() { button1 = 0; button2 = 0; x=0; y=0; cx = 0; cy = 0; } WinMouse::~WinMouse() { } void WinMouse::UpdateWindowCenter() { this->GetPos();  this->x = GetX() - this->cx;  this->y = GetY() - this->cy; } WinMouse::PosTest(int x, int y, int tx, int ty) {  if(x < (GetX() -RectA.left ) && x + tx > (GetX() -RectA.left ))  {   if( y < (GetY() - RectA.top) && y + ty > (GetY() - RectA.top) )   return 1;   else   return 0;  }  else  return 0; } void WinMouse::GetCenter() {  x = (RectA.right + RectA.left)/2;  y = (RectA.top + RectA.bottom)/2;    cx = x;  cy = y; } void WinMouse::SetCenter() {  x = RectA.left + RectA.right;  y = RectA.top + RectA.bottom;      cx = x/2;  cy = y/2;  SetCursorPos(x/2,y/2); }   void WinMouse::GetRectPos(RECT RectW) {    RectA.left = RectW.left;  RectA.right = RectW.right;  RectA.top = RectW.top;  RectA.bottom = RectW.bottom; } long WinMouse::CalcWindowX() {  return this->RectA.right + this->RectA.left; } long WinMouse::CalcWindowY() {  return this->RectA.top + this->RectA.bottom; }   void WinMouse::ResetPos(long Width, long Height) {  this->x = (long)(Width * (float).5);  this->y = (long)(Height * (float).5); SetCursorPos( this->x , this->y ); } void WinMouse::SetPos(long x, long y) { SetCursorPos(x, y); } void WinMouse::GetPos() { GetCursorPos(&this->CP); } long WinMouse::GetX() {  return this->CP.x;   } long WinMouse::GetY() {  return this->CP.y;   }   //EOF
  11. Mathimetric

    C++ String to a number

    EDITED DUE TOO THE COMMENT BELOW FROM MODERATION: ABOUT THE PROGRAM' MEMORY LEAK; (FIX)   did you try checking the string[Lvalue] characters by using...   <ctype.h>   int _RTLENTRY _EXPFUNC isalnum (int __c); int _RTLENTRY _EXPFUNC isalpha (int __c); int _RTLENTRY _EXPFUNC iscntrl (int __c); int _RTLENTRY _EXPFUNC isdigit (int __c); int _RTLENTRY _EXPFUNC isgraph (int __c); int _RTLENTRY _EXPFUNC islower (int __c); int _RTLENTRY _EXPFUNC isprint (int __c); int _RTLENTRY _EXPFUNC ispunct (int __c); int _RTLENTRY _EXPFUNC isspace (int __c); int _RTLENTRY _EXPFUNC isupper (int __c); int _RTLENTRY _EXPFUNC isxdigit(int __c); int _RTLENTRY _EXPFUNC isascii (int __c);   you could use these to maybe determine if you have a number or not. you could also try being more specific to handling the errors by using a pointer return value   such as typedef <type> number_;   //(EDIT)///////////////////////////////////////////////////////////////// // pointer rtn is givin a static address only 1 time so there is no memory leaks' // number_ * stringtonum(string_type  *) { static number_ * rtn;                                if( rtn == NULL){ rtn = new number_[2]; }   //where rtn[0] == error handle , rtn[1] == converted num //.........do conversion block ..............///   return rtn;  //return address to variable rtn }     example impliment:   #define out<<        .... #define error_       ....   if(   (*(stringtonum(data)+0)) ) out<<error_; //is there an error in rtn?  else assign = (*(stringtonum(data)+1));       ///edited to ocommidate  the BELOW COMMENT ///there is no leak if the return type is givin a static address -> to point too
  12. Mathimetric

    Starting Game Engine

    here is a link to them   http://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/index.html
  13. Mathimetric

    Starting Game Engine

    for starters with openGL, you should attempt learning the basics through use of books. my library of book phocus is :   beginning OpenGL game programming : dave astle , kevin hawkins more open gl programming game programming : dave astle editor data structures & other objects using C++ 3rd edition   you should also have a good book for c/c++ standard as used reference to coding. having a good understanding of data structures, OOP, classes, standard lib functions, macros, exetra is a must.   as for loading images the true vision extension ".tga" file is mostly or mainly used for textures because of its qualities of holding alpha values and color values, "RGBA"
  14. Mathimetric

    Text Based Game Layout

    I would suggest A scripting format for the design of the game; such for menu's and sequences. you might need say a Node tree structure.   you could create a script and your game would open them dynamically and output each step   say like i.e.   script<22>: "you Enter a Tavern , and the keep asks you if you want a room?" answer<1>:"yes" (goto)->script<100> answer<2>: "no"  (goto)->script<101> ... ... ... script<100>: (memory)->Int = Roll(20) case: (memory)->Int > 15 (goto)->script<23> case: (memory)->Int <= 15 (goto)->script<24>   //memory->int would be say a storage variable you can refer to //Roll(20) would be say a common function in the game you refer to that generates a number   the game would progress through your script file (Parsing the script via file pointer) and you could create or change the adventure or game any time you want using built in script functions and memory calls or sets and comparisons.   hope this helps your storm on the brain.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!