• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

sujandasmahapatra

Members
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

193 Neutral

About sujandasmahapatra

  • Rank
    Member
  1. OpenGL

    Please help me
  2. OpenGL

    If I put drawLine below the transformation the everything is rotating axes and line both, check below the code. How can I make only the axis should rotate and line remains fixed. Please help.   void CopenGLCoordView::DrawScene(CDC *pDC) {     wglMakeCurrent(pDC->m_hDC, m_hrc);     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);         glEnable(GL_DEPTH_TEST);     glMatrixMode(GL_MODELVIEW);     glLoadIdentity();       glPushMatrix();     glLoadIdentity();     glRotatef(rot[0], 1.0f, 0.0f, 0.0f);     glRotatef(rot[1], 0.0f, 1.0f, 0.0f);     glRotatef(rot[2], 0.0f, 0.0f, 1.0f);     drawAxes();     glPrintX("X");     glPrintY("Y");     glPrintZ("Z");     glPopMatrix();       drawLine();       glFlush();     SwapBuffers(pDC->m_hDC);         wglMakeCurrent(NULL, NULL); }
  3. OpenGL

      void CopenGLCoordView::drawAxes() {       CDC* pDC = GetDC();     wglMakeCurrent(pDC->m_hDC, m_hrc);     glBegin(GL_LINES);     glVertex3f(0.0f, 0.0f, 0.0f); // origin of the line     glVertex3f(5.0f, 0.0f, 0.0f); // ending point of the      glEnd();        glBegin(GL_LINES);     glVertex3f(0.0f, 0.0f, 0.0f); // origin of the line     glVertex3f(0.0f, 5.0f, 0.0f); // ending point of the      glEnd();        glBegin(GL_LINES);     glVertex3f(0.0f, 0.0f, 0.0f); // origin of the line     glVertex3f(0.0f, 0.0f, 5.0f); // ending point of the      glEnd();     wglMakeCurrent(NULL,NULL);      ReleaseDC(pDC); }   void CopenGLCoordView::drawLine() {     CDC* pDC = GetDC();     wglMakeCurrent(pDC->m_hDC, m_hrc);     glBegin(GL_LINES);         glVertex3f(10,0,0);         glVertex3f(20,0,0);     glEnd();     wglMakeCurrent(NULL,NULL);   } These are my drawaxes and drawLine code. Now my drawscene looks like this   void CopenGLCoordView::DrawScene(CDC *pDC) {     wglMakeCurrent(pDC->m_hDC, m_hrc);     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);         glEnable(GL_DEPTH_TEST);     glMatrixMode(GL_MODELVIEW);     glLoadIdentity();       drawLine();       glPushMatrix();     glLoadIdentity();     glRotatef(rot[0], 1.0f, 0.0f, 0.0f);     glRotatef(rot[1], 0.0f, 1.0f, 0.0f);     glRotatef(rot[2], 0.0f, 0.0f, 1.0f);     drawAxes();     glPrintX("X");     glPrintY("Y");     glPrintZ("Z");     glPopMatrix();              glFlush();     SwapBuffers(pDC->m_hDC);         wglMakeCurrent(NULL, NULL); }   I have made the glPushMatrix() before glLoadIdentity().......Nothing is rotating...I want only the axes should rotate, line remains fixed in space. Pls help.
  4. I want to rotate 2 objects out of 3. One object should remain static. But it’s not happening. Please help. I using glPushMatrix() and glPopMatrix() for the objects that I want to rotate.   void CopenGLCoordView::DrawScene(CDC *pDC) {     wglMakeCurrent(pDC->m_hDC, m_hrc);     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);         glEnable(GL_DEPTH_TEST);     glMatrixMode(GL_MODELVIEW);     glLoadIdentity();       drawLine();       glLoadIdentity();     glPushMatrix();     glRotatef(rot[0], 1.0f, 0.0f, 0.0f);     glRotatef(rot[1], 0.0f, 1.0f, 0.0f);     glRotatef(rot[2], 0.0f, 0.0f, 1.0f);     drawAxes();     glPrintX("X");     glPrintY("Y");     glPrintZ("Z");     glPopMatrix();              glFlush();     SwapBuffers(pDC->m_hDC);         wglMakeCurrent(NULL, NULL); }   With the above code nothing is rotating. I want the drawLine() line should be static while the axis and x,y,z should rotate. Please help how can I achieve this?..Thanks Sujan
  5. Dear Friends I have a dataset like below. 1 means Straight line with startPointX,startPointY,endPointX,endPointY. ////////////////////////////////////////////////////////////// 1 0.000000 24.600000 -15.500000 28.575000 1 -15.500000 28.575000 -37.700000 28.575000 1 -37.700000 28.575000 -37.700000 36.515000 1 -37.700000 36.515000 -59.920000 36.515000 1 -178.200000 52.000000 -138.200000 52.000000 1 0.000000 24.600000 0.000000 19.000000 1 -125.421613 36.515000 -138.200000 52.000000 1 -123.421613 36.515000 -107.873000 36.515000 1 -100.000000 19.000000 0.000000 19.000000 1 -105.873000 36.515000 -94.557821 36.515000 1 -66.103821 36.515000 -88.374000 36.515000 1 -100.000000 19.000000 0.000000 19.000000 1 0.000000 19.000000 0.000000 24.600000 1 0.000000 24.600000 -15.500000 28.575000 1 -15.500000 28.575000 -37.700000 28.575000 1 -37.700000 28.575000 -37.700000 36.515000 1 -37.700000 36.515000 -59.920000 36.515000 1 -66.103821 36.515000 -88.374000 36.515000 1 -94.557821 36.515000 -105.873000 36.515000 1 -107.873000 36.515000 -123.421613 36.515000 1 -125.421613 36.515000 -138.200000 52.000000 1 -138.200000 52.000000 -178.200000 52.000000 1 -115.000000 0.000000 -115.000000 15.000000 1 -115.000000 15.000000 -100.000000 15.000000 1 -100.000000 15.000000 -100.000000 19.000000 1 -100.000000 19.000000 0.200000 19.000000 1 0.200000 19.000000 0.000000 19.000000 1 0.000000 19.000000 0.000000 24.574923 1 0.000000 24.574923 -0.000000 24.600000 1 0.000000 24.600000 -15.500000 28.575000 1 -15.500000 28.575000 -37.700000 28.575000 1 -37.700000 28.575000 -37.700000 36.515000 1 -37.700000 36.515000 -59.920000 36.515000 1 -59.920000 36.515000 -66.103821 36.515000 1 -66.103821 36.515000 -88.374000 36.515000 1 -88.374000 36.515000 -94.557821 36.515000 1 -94.557821 36.515000 -105.873000 36.515000 1 -105.873000 36.515000 -107.873000 36.515000 1 -107.873000 36.515000 -123.421613 36.515000 1 -123.421613 36.515000 -125.421613 36.515000 1 -125.421613 36.515000 -138.200000 52.000000 1 -138.200000 52.000000 -178.200000 52.000000 1 -178.200000 52.000000 -178.200000 52.500000 1 -178.200000 52.500000 -178.200000 55.000000 1 -178.200000 55.000000 -190.000000 55.000000 1 5.000000 0.000000 5.000000 55.000000 1 5.000000 55.000000 -190.000000 55.000000 ////////////////////////////////////////////////////////////// I have to construct a profile which I can easily do by making a GL_LINES. After that I need rotate the profile by x-axis and construct a surface of revolution. Please giveme some idea how can I achieve this. I have done something but I am not getting the surface. Like I am storing the original startPoints and endPoints in an array with assuming z=0. Then rotating each point by x-axis. so x-values will be same and y and z values I am calculating using this formula. y = y cosq - z sinq; z = ysinq + zcosq; Is this correct...?? Then I am defining a number of loops and in loop I am creating GL_QUADS for each startPoint and endPoint... 1st loop 1ststartPoint, 1stLoop 1stendPoint 2nd loop 1stStartPoint, 2nd loop 1stEndPoint... But I am not getting any 3D surface. Please help me.........Check the code below. ////////////////////////////////////////////////////////////////////////////////////////////////////////// typedef struct point3D{ float x; float y; float z; }POINT3D; int count1; POINT3D *startPoints, *endPoints; void CRevolutionProjView::drawProfile(CString filename) { pFrame->m_wndStatusBar.SetPaneText(0,L"DrawProfile !!"); // profile to be drawn GLfloat PI = 4 * atan(1.0); //file needs be open double startPX, startPY, endPX, endPY; double cenX, cenY, cenZ, rad, startA, endA; ifstream indata; // indata is like cin int id; // variable for input value indata.open(filename); // opens the file if(!indata) { // file couldn't be opened cerr << "Error: file could not be opened" << endl; exit(1); } count1=0; while ( !indata.eof() ) { // keep reading until end-of-file indata >> id; cout << "The id is " << id << endl; if(id==1) { indata >> startPX >> startPY >> endPX >> endPY; glBegin(GL_LINES); glVertex2f(startPX, startPY); // origin of the line glVertex2f(endPX, endPY); // ending point of the line glEnd(); if(count1==0) { startPoints = (POINT3D *)malloc(sizeof(POINT3D)); endPoints = (POINT3D *)malloc(sizeof(POINT3D)); } else { startPoints = (POINT3D *)realloc(startPoints,sizeof(POINT3D)*(count1+1)); endPoints = (POINT3D *)realloc(endPoints,sizeof(POINT3D) * (count1+1)); } startPoints[count1].x = startPX; startPoints[count1].y = startPY; startPoints[count1].z = 0.0f; endPoints[count1].x = endPX; endPoints[count1].y = endPY; endPoints[count1].z = 0.0f; count1++; } } indata.close(); cout << "End-of-file reached.." << endl; } void CRevolutionProjView::drawSurface() { double PI = 4.0 * atan(1.0); //I have x and y points; //count1 = numberof points //theta = 0 to 360 degs. //nsweep = number of sweeps. 360/nsweep = each angle; int nsweep=4; //no of profiles = nsweep + 1... //each profile will have count1 no of lines...so count1 startpoints and count1 endPoints... //so...total startPoints and endPoints for (nsweep+1) profiles = (nsweep+1) * count1... POINT3D *totalStartPoints, *totalEndPoints; totalStartPoints = new POINT3D[(nsweep+1)*count1]; totalEndPoints = new POINT3D[(nsweep+1)*count1]; int cnt1=0; double theta, inter; inter = (360/nsweep) * (PI/180); theta = 0; for(int i=0; i<(nsweep+1); i++) { for(int j=0; j<count1; j++) { totalStartPoints[cnt1].x = startPoints[j].x; totalStartPoints[cnt1].y = startPoints[j].y * cos(theta) - startPoints[j].z * sin(theta); totalStartPoints[cnt1].z = startPoints[j].y * sin(theta) + startPoints[j].z * cos(theta); totalEndPoints[cnt1].x = endPoints[j].x; totalEndPoints[cnt1].y = endPoints[j].y * cos(theta) - endPoints[j].z * sin(theta); totalEndPoints[cnt1].z = endPoints[j].y * sin(theta) + endPoints[j].z * cos(theta); cnt1++; } theta = theta + inter; } cnt1=0; glColor3f(1.0f,0.0f,0.0f); for(int i=0; i<nsweep; i++) { for(int j=0; j<count1; j++) { GLfloat *v0, *v1, *v2, *v3; v0 = new GLfloat[3]; v1 = new GLfloat[3]; v2 = new GLfloat[3]; v3 = new GLfloat[3]; v0[0] = totalStartPoints[cnt1].x; v0[1] = totalStartPoints[cnt1].y; v0[2] = totalStartPoints[cnt1].z; v1[0] = totalEndPoints[cnt1].x; v1[1] = totalEndPoints[cnt1].y; v1[2] = totalEndPoints[cnt1].z; v2[0] = totalEndPoints[cnt1+count1].x; v2[1] = totalEndPoints[cnt1+count1].y; v2[2] = totalEndPoints[cnt1+count1].z; v3[0] = totalStartPoints[cnt1+count1].x; v3[1] = totalStartPoints[cnt1+count1].y; v3[2] = totalStartPoints[cnt1+count1].z; glBegin(GL_QUADS); // draw a cube with 6 quads glVertex3fv(v0); // front face glVertex3fv(v1); glVertex3fv(v2); glVertex3fv(v3); glEnd(); delete v0; delete v1; delete v2; delete v3; cnt1++; } } //////////////////////////////////////////////////////////////////////////////////////////////////////////
  6. Dear Friends I am wirting an application for drawing a rectangle on the screen using opengl and mfc. So I implemented the OnPaint function, OnDraw function is also giving the same problem. It's drawing fine. I want to implement pan, zoom, and rotate functionalities. Now everytime the mouse moves I am calling Invalidate() or otherwise I can call Invalidate() in the ::OnDraw function. Pan, zoom and rotate everything is happening but its heavily flickering. I have serached a lot and tried all means like return 1 in the OnEraseBackground() functio for WM_ERASEBACKGROUND etc. But I am getting still flickering . Please help getting rid of this problem. Check the code snippet below. void CRevolutionProjView::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here CRect RectAff; GetClientRect(RectAff); glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f ) ; glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; glPushMatrix( ) ; glTranslatef(trans[0], trans[1], trans[2]); glRotatef(rot[0], 1.0f, 0.0f, 0.0f); glRotatef(rot[1], 0.0f, 1.0f, 0.0f); drawcube(); glPopMatrix( ) ; glFinish( ) ; glFlush(); SwapBuffers(hDC); Invalidate(false); // Do not call CView::OnPaint() for painting messages } void CRevolutionProjView::OnMouseMove(UINT nFlags, CPoint point) { newP = point; // TODO: Add your message handler code here and/or call default int dx = oldP.x - newP.x; int dy = newP.y - oldP.y; switch(STATE) { case PAN: { trans[0] -= dx/100.0f; trans[1] -= dy/100.0f; // Invalidate(); } break; case ZOOM: { trans[2] -= (dx+dy) / 100.0f; // Invalidate(); } break; case ROTATE: { rot[0] += (dy * 180.0f) / 500.0f; rot[1] -= (dx * 180.0f) / 500.0f; #define clamp(x) x = x > 360.0f ? x-360.0f : x < -360.0f ? x+=360.0f : x clamp(rot[0]); clamp(rot[1]); // Invalidate(); } break; } oldP = newP; CView::OnMouseMove(nFlags, point); }
  7. Dear All I am a freelancer software developer using QT C++ OPENGL(for 3D Graphics) PythonQt (for scripting automation and session file generation). If anyone interested to explore your project with me please contact at the following details. My specialized areas are CAD/CAE/CAM/CFD AERO MECHANICAL PROBLEMS & DESIGN I can provide remote service. Thanks & Regards Sujan Dasmahapatra B.E. (Aeronautics) Bangalore, India Ph:91-9900839788 mail id : sujan.dasmahapatra@gmail.com yahoo msn : dasmahapatra.aerodynamics@yahoo.co.in icq # 556023244 skype:sujan.dasmahapatra@skyepe.com msn: sujan.dasmahapatra@hotmail.com
  8. Hi I am looking for work from projects for developing any engineering software CAD/CAM/CAE/FEA/CFD, I am an expert in CC++, VC++,MFC,OPENGL,QT,QWT...in CAD/CAM/CAE/CFD atc... if anyone interested please call me @919900839788
  9. Can somebody help me with how can I zoom in and zoom out my objects on the screen ! I am trying with gluPerspective() bby changing angle bbut unsuccessfuk ! Any help would be highly appreciated !! Thanks sujan
  10. OpenGL

    1>win32_util.c 1>win32_winproc.c 1>win32_x11.c 1>Generating Code... 1>Compiling resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Compiling manifest to resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>.\glut.def(1) : warning LNK4017: DESCRIPTION statement not supported for the target platform; ignored 1> Creating library .\Debug/glut32.lib and object .\Debug/glut32.exp 1>Embedding manifest... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Copying libraries, headers & dll's... 1> 1 file(s) copied. 1>The system cannot find the path specified. 1> 0 file(s) copied. 1>The system cannot find the path specified. 1> 0 file(s) copied. 1>Project : error PRJ0019: A tool returned an error code from "Copying libraries, headers & dll's..." 1>Build log was saved at "file://F:\OpenGL\glut-3.7.6\lib\glut\Debug\BuildLog.htm" 1>glut32 - 1 error(s), 15 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Can anyone tell me firneds why I am getting this error..I just extract the original glut-3.7.6 and then tried to compile it according to the istructions.Thats right that I can manually keep the dll,lib and header in correponding places but still I want to build it so that it automatically builds and keeps those files at the proper places....Plsss help me.