Tirdad

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

128 Neutral

About Tirdad

  • Rank
    Newbie
  1. Hi there buds Ive got a littile problem ... and feel confessed Imagine a Solid Cube , free fallin on a sphere . how can i descibe that ? how we can set openGL to simulate a gravity ? note that gravity is a ACCELERATED move (sure we can use translatef and define a function to increas the amount of translation periodically ) the main problem is Collision ! the cube falls and i want it to be realstic . some little bounces and a realstic angular reactions . how is this possible ? you can point me to this book as refrence : OpenGL programming guid 7th edition , the official guide to lerning opengl 30 and 3.1 , dave shreiner , the khronos opengl ARB working group . and the platfotm im workin : Win 7 Visual C++ Express edition 2010 Glut and at last ... thanx it will be really appreciated fellas
  2. hi there m8s . i'v got a problem with this function . i'm using Visual C++ 2010 Exprss to practice openGL under glut (freeglut) when i use this function out of main() loop , it takes an error that says : "missing type specifier - int assumed. Note: C++ does not support default-int error C2365: 'glEnableClientState' : redefinition; previous definition was 'function' see declaration of 'glEnableClientState' " note that using this function (or relevant funcs) in main() , does not return error but it also doesnt work ! the included files : <windows.h> <GL\GLU.h> <gl\GL.h> <GL\freeglut.h>
  3. [size="2"]hi there m8s . i'v got a problem with this function . i'm using Visual C++ 2010 Exprss to practice openGL under glut (freeglut) when i use this function out of main() loop , it takes an error that says : "[/size][size="2"]missing type specifier - int assumed. Note: C++ does not support default-int[/size] [size="2"] error C2365: 'glEnableClientState' : redefinition; previous definition was 'function'[/size] [size="2"]see declaration of 'glEnableClientState' " note that using this function (or relevant funcs) in main() , does not return error but it also doesnt work ! the included files : [size="2"][font="Consolas"] [/font][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"]<windows.h>[/color][/font][/color][/font][/color][/font][/size][font="Consolas"][size="2"][color="#0000ff"] [/color][/size][/font][size="2"][font="Consolas"] [/font][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"]<GL\GLU.h>[/color][/font][/color][/font][/color][/font][/size] [size="2"][font="Consolas"] [/font][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"]<gl\GL.h>[/color][/font][/color][/font][/color][/font][/size] [size="2"][font="Consolas"] [/font][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"][font="Consolas"][color="#a31515"]<GL\freeglut.h> [/color][/font][/color][/font][/color][/font][/size] [font="Consolas"][size="2"][color="#a31515"][font="Consolas"][size="2"][color="#a31515"][font="Consolas"][size="2"][color="#a31515"][/color][/size][/font][/color][/size][/font][/color][/size][/font][/size]
  4. [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Hi there[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I’m using openGL with GLUT framework .[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I’ve got some problem with my first code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Here’s the condiotion :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Windows 7 64 bit[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]DevC++ , Pelles C compiler[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]GLUT 3.7[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]==============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I got the GLUT 3.7 files from the site .[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]In which folders I must put them ? glut.h / glut.lib /glut.dll[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]And the code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]==============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <windows.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/glut.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/gl.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/glu.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]void display(void)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glClear(GL_COLOR_BUFFER_BIT);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glColor3f(1.0,1.0,1.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glBegin(GL_POLYGON);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.25,0.25,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.75,0.25,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.75,0.75,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.25,0.75,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glEnd();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glFlush();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]void init(void)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glClearColor(0.0,0.0,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glMatrixMode(GL_PROJECTION);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glLoadIdentity();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]int main(int argc,char** argv)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInit(&argc,argv);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitWindowSize(250,250);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitWindowPosition(100,100);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutCreateWindow("hello");[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]init();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutDisplayFunc(display);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutMainLoop();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]return0;[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Error code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]========================================================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(24): error #2070: Insufficient number of arguments to'function'.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(30): warning #2203: Function 'main' can't be __stdcall,changed to __cdecl.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(37): warning #2168: Operands of '=' have incompatibletypes 'void __cdecl function(void)' and 'void __stdcall function(void)'.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\ProgramFiles\PellesC\Include\Win\GL\glut.h(549): warning #2135: Static'glutCreateMenu_ATEXIT_HACK' is not referenced.[/b] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]========================================================[/size][/font] [font="Times New Roman"][size="3"][/size][/font]
  5. [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Hi there[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I’m using openGL with GLUT framework .[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I’ve got some problem with my first code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Here’s the condiotion :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Windows 7 64 bit[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]DevC++ , Pelles C compiler[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]GLUT 3.7[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]==============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]I got the GLUT 3.7 files from the site .[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]In which folders I must put them ? glut.h / glut.lib /glut.dll[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]And the code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]==============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <windows.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/glut.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/gl.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]#include <GL/glu.h>[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]void display(void)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glClear(GL_COLOR_BUFFER_BIT);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glColor3f(1.0,1.0,1.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glBegin(GL_POLYGON);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.25,0.25,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.75,0.25,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.75,0.75,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glVertex3f(0.25,0.75,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glEnd();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glFlush();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]void init(void)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glClearColor(0.0,0.0,0.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glMatrixMode(GL_PROJECTION);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glLoadIdentity();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]int main(int argc,char** argv)[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]{[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInit(&argc,argv);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitWindowSize(250,250);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutInitWindowPosition(100,100);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutCreateWindow("hello");[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]init();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutDisplayFunc(display);[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]glutMainLoop();[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"] [size="3"]return0;[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]}[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]============================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]Error code :[/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]========================================================[/size][/font] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(24): error #2070: Insufficient number of arguments to'function'.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(30): warning #2203: Function 'main' can't be __stdcall,changed to __cdecl.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\Users\Tirdad\Documents\PellesC Projects\first\gl1.c(37): warning #2168: Operands of '=' have incompatibletypes 'void __cdecl function(void)' and 'void __stdcall function(void)'.[/b] [font="Times New Roman"][size="3"][/size][/font][b]C:\ProgramFiles\PellesC\Include\Win\GL\glut.h(549): warning #2135: Static'glutCreateMenu_ATEXIT_HACK' is not referenced.[/b] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"] [/size][/font] [font="Times New Roman"][size="3"][/size][/font][font="Calibri"][size="3"]========================================================[/size][/font] [font="Times New Roman"][size="3"][/size][/font]