Jump to content
  • Advertisement

Mathimetric

Member
  • Content count

    17
  • Joined

  • Last visited

Community Reputation

133 Neutral

About Mathimetric

  • Rank
    Member

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

    BuggyRace

    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
  • 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!