You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(27) |
Nov
(3) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(71) |
Feb
(27) |
Mar
(17) |
Apr
(18) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
|
Oct
(11) |
Nov
(12) |
Dec
|
2003 |
Jan
|
Feb
(5) |
Mar
(5) |
Apr
(2) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
2004 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Chad A. <ae...@vr...> - 2004-11-10 04:23:30
|
-------- Original Message -------- Subject: Would you guys be interested in this? Date: Tue, 9 Nov 2004 14:47:45 -0600 From: Jim Schlosser <bi...@cs...> To: isu...@li... http://imagine.thespoke.net/invitationals/visualgaming.aspx Prizes are pretty good. More than one team can compete from each school too. Let me know what you think. -- Jim Schlosser aka bi...@cs... | Finger for PGP Public Key Manager, Systems Support Group, Department of Computer Science 226 Atanasoff Hall, Iowa State University, Ames, Iowa 50011-1041 Ph:515-294-0179 FAX:515-294-0258 URL:http://www.cs.iastate.edu/~bigjim |
From: Chad A. <ae...@vr...> - 2004-05-15 08:50:41
|
(Replying on the isugamedev-devel mailing list. If you're not signed up=20 for that, Michael, you may want to do so. There are probably=20 instructions at http://isugamedev.sourceforge.net/ ) I doubt there will be many (if any) meetings over the summer, and I=20 don't know if any groups are working on games together. I have a few=20 projects up my sleeve... What kind of game are you thinking of? Chad Michael Lindseth wrote: > i'm interested in attending meetings. i assume many who show initial=20 > interest have some kind of huge, unrealistic game idea in mind. i kno= w=20 > i do. >=20 > so, is there anything going on this summer? >=20 > mike >=20 > _________________________________________________________________ > FREE pop-up blocking with the new MSN Toolbar =96 get it now!=20 > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |
From: Chad A. <ae...@vr...> - 2004-02-03 05:55:09
|
Hi Brett, I'm forwarding this on to the isugamedev-devel mailing list to see if anyone is interested. Chad Brett L Trotter wrote: > I am the head of a project to port bzflag over to various gaming consoles. Was > wondering if the club was interested in getting involved, or had any members > that may be interested on the side? |
From: Chad A. <ae...@vr...> - 2004-01-22 08:40:59
|
Pretty sweet idea. Even supports threaded rendering for you SMP users: http://www.virtualray.ru/eng/download.html |
From: Chad A. <ae...@vr...> - 2004-01-02 20:32:09
|
I just found a project some of you may be interested in: ZEngine. http://zengine.sourceforge.net/ It's a 2D engine that wraps SDL. If you want to try making a 2D game, it's worth looking at. Chad |
From: Chad A. <ae...@vr...> - 2003-11-16 03:44:14
|
http://www.realityfactory.ca/v3/ <-- This is pretty cool, especially for the people who are interested in making a 3D game. |
From: Jason N. <ne...@ia...> - 2003-11-11 15:41:47
|
I just found out I have rehearsal for a play that I'm in at 1:00 today, and I *HAVE* to go (heh, we perform in a week, and my lines arent memorized..). Which means I'll most likely be late for the meeting today, if I'm able to make it at all. Sorry about bailing out these last few mtgs, but life's getting a whole lot busier right around now! Still, though I hope to make it to the meeting - if you could email me w/ the location you end up meeting at, I'll try to get there after rehearsal's over. Thanks! Jason |
From: Michael H. <mh...@ia...> - 2003-11-09 22:52:10
|
Hey all- The 3D group will be having another meeting on Tuesday from 2:30ish to however long we feel like working on it, 2 hrs or more most likely. We can have the meeting in Atanasoff Room B29 again or in Howe Hall somewhere. If someone knows a good room in Howe Hall that isn't used during that time, please let us know. We will be working on utilizing OpenDE for our project and furthering the development of the base engine. -Mike |
From: Brian B. <bba...@ia...> - 2003-11-04 23:50:29
|
Here's a link to the delta force demo if you're interested in what their "voxel" engine looked like. The demo is only about 18 megabytes. http://brian3.student.iastate.edu/dfdemo4.exe |
From: Jason N. <ne...@ia...> - 2003-11-04 23:07:00
|
Here's a link to the scenegraph I put together. Running it doesn't actually DO anything, but the GfxObj.h/.cpp and GfxGroup.h/.cpp contain their respective classes. Here you go! http://www.cs.iastate.edu/~nehf/scene.zip -Jason |
From: Jason N. <ne...@ia...> - 2003-11-04 19:04:04
|
Just a suggestion - everyone might want to switch from getting the list messages in digest form (ie, all msgs sent during a day compiled and sent all at once at the end of that day) to getting them individually. Yes, this will make your inbox a little messy if we start flinging msgs around, but they'll most likely get to you more quickly - ie, within a few minutes (hopefully?) instead of 11:59.59pm that night. That way, if someone sends out a quick "YO! CHANGE OF PLANS!", you'll get it. Ok. Go. Mush! Heh. -Jason |
From: Jason N. <ne...@ia...> - 2003-11-04 18:59:21
|
*** Disclaimer *** Hey all in the gamedev club - this message is meant for those members in the 3D project group. If you're in the 2D group and *DON'T* feel like defecting over to the dark side (heh), you can ignore this. To all who wish to be a part of the 3D project group, this applies to you too. *** /Disclaimer *** Hey guys, Mike suggested we meet in an Atanasoff lab.. I'm not sure what the lab schedule is, but I do have a little bit of experience in writing up a design doc. For the most part, it works best when there's only one person at the computer and the other people are giving out ideas for that person to type in, rather than having everyone at their own computers. So, I guess I'm suggesting we meet in a classroom that's not being used or something of that nature. Also, that way we won't bother people who *are* doing something important or something. The basement classroom of Atan (B29???) might be good, or perhaps one of the upstairs recitation rooms. If none of those ideas pan out, I'm sure we'll find something. I'll bring my laptop, and anyone who has a laptop too might want to bring it if they have something to show. I'll also bring that book I mentioned Saturday, the Game Architecture and Design book. It might come in handy? As for a time, 2:30 sounds good to me. I'll be hanging around in some lab in Atanasoff - if I see either of you, or either of you see me, we'll find someplace to go. I hope you guys get this message in time.. I know it doesn't REALLY state anything new, but.. yeah.. anyways. See you around 2:30! -Jason Nehf |
From: Michael H. <mh...@ia...> - 2003-11-02 02:22:35
|
Jason, Brian, and I are thinking about scheduling some lab time for the 3d group. Tuesday afternoon after about 2:30 or so seems to work for us. The comp lab in Atanasoff is prolly a good place to have it. We'll be working on fleshing out a good design doc before we get too deep, while also trudging ahead with preliminary code. Brian's got the height map thingie done and Jason's working on model loading and scene graph stuff. Email back if you wanna suggest a better lab place or something else. -Mike Holtan |
From: Ben S. <bs...@ia...> - 2003-05-27 05:34:03
|
Ian Overton wrote: > Thanks for all the info, but I haven't done this kind of stuff so long I > still don't understand. Allow I do see what I need to do. I don't understand > what some of the things are that you are doing. No worries. Sometimes I forget how long I've been doing this and gloss over some of the more important details. Hell, I'll probably just confuse you with this response by trying to go into more detail. ;) Keep pinging the list until you've got it all worked out though! > >>From what I understand I should make a ray where the starting point is > transformedx, transformedy, 0 and the ending point is > transformedx, -10(where my plane is), and some point z where transformedx > and y are what they are in world coordinates provided by the gluproject and > I can figure out the z coord by figuring out the slope from the two z coords > I put in. That is what I understood I was supose to do, but I really have no > idea how to do some of these. Sort of. Imagine that your screen is simply a plane in the virtual world. Your mouse cursor is somewhere on that plane. You want to cast a ray straight out of that screen and see where it hits the plane. A whiteboard would be great here. ;) What you have is a point on that plane (mx, my, 0) in a coordinate system where +X heads to the right, +Y heads up, and +Z goes into the screen. You rightfully want to transform that from view(screen) coordinate space to world coordinate space. That's what gluUnProject is for. Lets say that gives us the transformed coord (tx, ty, tz). Now this new position is relative to the world origin rather than the upper left corner of the screen. However, you want to cast a ray out into the world starting from the screen. A ray is a starting point (origin) and a direction vector. Remember that a ray has no end point. The transformed mouse position would work well as the ray's origin, but you still need to figure out what direction in which to cast the ray. That's where that extra transformed point comes in handy. If you get the position of the mouse not on the screen, but slightly into it (say (mx, my, 0.02) you have two points that lie on the line you want your ray to be on. You can then calculate the direction of the ray by taking difference between the two points and then making that direction vector of unit length. Now that you have the ray (assuming you already have knowledge about your plane), you can compute the intersection between them. That intersection is the point at which the mouse would project to the plane. > >>// Unproject the point of the mouse to form a ray into the screen >>Point beg = // gluUnProject on the point (x,y,0.0) >>Point end = // gluUnProject on the point (x,y,0,02) >> >>// Create the ray >>Vector direction = end - beg; > > > why are you taking end-beg again I thought you needed end for the > magnatuide, but end-beg is easy enough to understand. To create a vector in cartesian coordinates (x,y,z) given two points in space, you need to subtract the point at the beginning of the vector from the end of it. That will give you a vector from beg to end. > > direction.normalize(); > I'm not sure what this does, but from I understand normalize just gives a > right angle of whatever the plane or line is and it looks to me like > direction would be just a point. I've found some info on normalizing > something with three points, because it makes up a plane, but I haven't > found one with two points, but I think you can do it. I'm not sure though If you normalize a vector, you change its length to be of unit length (1.0). To do this, you simply divide each component by the length of the vector. In other words, length = direction.length(); direction.x = direction.x / length; direction.y = direction.y / length; direction.z = direction.z / length; > > Ray ray(beg, direction); > This makes a ray where beg is the starting point and direction is a vector > that makes the slope and direction for the ray. Although I'm not sure how we Right! > made it. Also to get a ray like that do I just add beg to the direction > vector, so beg is where 0,0,0 was? By having the beginning and the direction, you already have enough knowledge to represent the ray. You can find any point along the ray by doing: pt = beg + direction * t Where t is the distance along the direction vector to travel to get to pt. > > >>// Create the plane >>Point plane_position = // Some point on the plane >>Vector plane_normal = // The plane's normal >>Plane plane(plane_normal, plane_position); > > > Not really sure what this does, does it create my grid? what is point > plane_position supose to be -10? and I'm not sure what the other two do > either. That part was really me just trying to represent your grid in some simple fashion. I assumed that you already have a point that lies on the grid (plane_position). I also assumed that you have (or can calculate) a vector of unit length pointing up from the grid (plane_normal). Lets say that your grid is defined as running from (-1, -1, -10) to (1, 1, -10) on the Z-plane where z=-10. That would be two opposite corners on the grid. Given that information, either point could be plane_position. > > >>// Intersect the ray with the plane >>dist = plane.intersect(ray); >>if (dist < 0.0) >>{ >> // No intersection >>} > > > plane.intersect(ray) returns how long the ray is when it hits my grid? Right. It would return the t part of the ray equation from above. > > >>// Find the point of intersection >>Point pos_on_plane = ray.getOrigin() + ray.getDirection() * dist; > > ok ray.getOrigin is beg + the direction vector I have no idea how we got and > then times the distance of the ra That's the ray equation from above. pt = beg + direction * t ray.getOrigin() is beg. ray.getDirection is direction. dist is t. > > I'm not sure if I broke it down right. Could you please explain it a little > more? It has been a long time since I've messed with math like this and I've > just started learning opengl a few days ago. I really want to learn how to > do this. I've been trying to figure it out for the passed 4 days and it's > driving me nuts. Thanks so much for the help I hope that helped more. Let me know if I answered your questions or if you have any more. I can probably come up with the plane/ray intersection algorithm if you need it. Happy coding! cheers, -Ben Scott bs...@ia... > > Ian Overton > > ----- Original Message ----- > From: "Ben Scott" <bs...@ia...> > To: "Chad Austin" <ae...@vr...> > Cc: "Ian Overton" <ove...@ia...>; "gdd" > <isu...@li...> > Sent: Monday, May 26, 2003 4:48 PM > Subject: Re: [isugamedev-devel] Re: Problem > > > >>Unfortunately, as far as I can tell, gluUnProject is not as useful as it >>probably should be. What you can get out of it is a the position of your >>(x,y,z) screen coord in object/world coordinates. While that sounds >>useful in and of itself, it's really not. >> >>It sounds like you're trying to project the mouse position onto a plane >>(your grid). What has worked for me in the past is to get two points >>using gluUnProject, one at the screen position (z=0) and one slightly >>into the screen (z=0.02) [Yes, that is positive 0.02. In view >>coordinates Z points into the screen]. With those two points you can >>create a ray starting at the screen position cast in the direction of >>your plane. From there you can find the intersection point of the ray >>and the plane. With all that you can "click" on the grid. >> >>Some fun code (based on yours). This is more pseudocode than anything >>with the assumption of some basic classes defined (Point, Vector, ...). >> >>//--------------------------------------------------- >> >>// Unproject the point of the mouse to form a ray into the screen >>Point beg = // gluUnProject on the point (x,y,0.0) >>Point end = // gluUnProject on the point (x,y,0,02) >> >>// Create the ray >>Vector direction = end - beg; >>direction.normalize(); >>Ray ray(beg, direction); >> >>// Create the plane >>Point plane_position = // Some point on the plane >>Vector plane_normal = // The plane's normal >>Plane plane(plane_normal, plane_position); >> >>// Intersect the ray with the plane >>dist = plane.intersect(ray); >>if (dist < 0.0) >>{ >> // No intersection >>} >> >>// Find the point of intersection >>Point pos_on_plane = ray.getOrigin() + ray.getDirection() * dist; >> >>// Jump up and down and celebrate our achievement >>doTheHappyDance(); >> >>//--------------------------------------------------- >> >>I hope that helps. Good luck! >> >>cheers, >>-Ben Scott >>bs...@ia... |
From: Ben S. <bs...@ia...> - 2003-05-26 22:11:59
|
Unfortunately, as far as I can tell, gluUnProject is not as useful as it probably should be. What you can get out of it is a the position of your (x,y,z) screen coord in object/world coordinates. While that sounds useful in and of itself, it's really not. It sounds like you're trying to project the mouse position onto a plane (your grid). What has worked for me in the past is to get two points using gluUnProject, one at the screen position (z=0) and one slightly into the screen (z=0.02) [Yes, that is positive 0.02. In view coordinates Z points into the screen]. With those two points you can create a ray starting at the screen position cast in the direction of your plane. From there you can find the intersection point of the ray and the plane. With all that you can "click" on the grid. Some fun code (based on yours). This is more pseudocode than anything with the assumption of some basic classes defined (Point, Vector, ...). //--------------------------------------------------- // Unproject the point of the mouse to form a ray into the screen Point beg = // gluUnProject on the point (x,y,0.0) Point end = // gluUnProject on the point (x,y,0,02) // Create the ray Vector direction = end - beg; direction.normalize(); Ray ray(beg, direction); // Create the plane Point plane_position = // Some point on the plane Vector plane_normal = // The plane's normal Plane plane(plane_normal, plane_position); // Intersect the ray with the plane dist = plane.intersect(ray); if (dist < 0.0) { // No intersection } // Find the point of intersection Point pos_on_plane = ray.getOrigin() + ray.getDirection() * dist; // Jump up and down and celebrate our achievement doTheHappyDance(); //--------------------------------------------------- I hope that helps. Good luck! cheers, -Ben Scott bs...@ia... Chad Austin wrote: > Ian Overton wants to convert screen coordinates to coordinates on a grid > that he has drawn (with perspective). I've never used gluUnProject > before... Can someone help him? > > Thanks, > Chad > > Ian Overton wrote: > >> Alright I want to figure out how to take the mouse coords and convert >> them to something on the x z plane. I have made a grid and I want to >> be able to click on the grid and know exactly where that click was on >> that grid, so I will be able to make a wall. Problem is I have no idea >> how to do it, cause of the prespective and I've looked everywhere and >> they don't seem to know either. My code is in the broken_metal file. >> >> I have also found something that does kind of what I want, but when I >> try and do it to the grid it always gives huge numbers and it seems it >> does that on that unproject to, but yet it works. I don't know, can >> check it out and see if you can figure it out? >> I believe glGetIntegerv(GL_VIEWPORT,viewport); >> y=viewport[3]-y; >> wy=y; >> glGetDoublev(GL_MODELVIEW_MATRIX,modelview); >> glGetDoublev(GL_PROJECTION_MATRIX,projection); >> glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&wz); >> gluUnProject(wx,wy,wz,modelview,projection,viewport,&ox,&oy,&oz); >> >> is the meat and patatos I don't really need to use glreadpixel, >> because I only need two of the three coords. The y coord is -10 >> >> >> >> ------------------------------------------------------------------------ >> >> // GLRect.c >> // The Drawing a simple 3D rectangle program with GLUT >> // OpenGL SuperBible, 2nd Edition >> // Richard S. Wright Jr. >> >> #include <windows.h> >> #include <gl/glut.h> >> #include <vector> >> #include <math.h> >> >> #define DEGTORAD(x) ((x)*0.017453292519943296) >> >> std::vector<int> walls; >> bool gofast=0; >> int window_width=0; >> int window_hieght=0; >> >> struct CAMERA >> { >> float position[3]; >> float orientation[3]; >> } cameraData; >> >> CAMERA pCamera; >> // Called to draw scene >> void RenderScene(void) >> { >> // Clear the window with current clearing color >> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); >> // Save matrix state and do the rotation >> glPushMatrix(); >> glRotatef(pCamera.orientation[0], 1.0f, 0.0f, 0.0f);//turn and >> move the camera to the rigth place >> glRotatef(pCamera.orientation[1], 0.0f, 1.0f, 0.0f); >> glRotatef(pCamera.orientation[2], 0.0f, 0.0f, 1.0f); >> glTranslatef(-pCamera.position[0],pCamera.position[1],pCamera.position[2]); >> >> >> glBegin(GL_LINES); >> glColor3f(0.0f, 1.0f, 1.0f); >> >> for(int y=-500; y<=500; y+=5) //make a grid >> { >> glVertex3i(y,-10,-500); >> glVertex3i(y,-10,500); >> glVertex3i(-500,-10,y); >> glVertex3i(500,-10,y); >> } >> >> glLoadIdentity(); >> glColor3f(1.0f, 1.0f, 1.0f); >> if(!walls.empty()) { >> for(y=0; y<walls.size(); y+=4)//plot my points I made with the >> mouse >> { >> glVertex3i(walls[y],-1,walls[y+1]); >> glVertex3i(walls[y+2],-1,walls[y+3]); >> } >> } >> glEnd(); >> >> // Restore transformations >> glPopMatrix(); >> >> glutSwapBuffers(); >> } >> >> void Keys(unsigned char key, int x, int y) >> { >> float fAngularVelocityX,fAngle; >> if(key == 'a') >> fAngularVelocityX = -5.0f; //look up >> >> if(key == 'z') >> fAngularVelocityX = 5.0f; //look down >> >> if(key == 0x1b)//esc quit >> exit(0); >> >> if(key == 'r' && !gofast) //run >> gofast=1; >> else >> gofast=0; >> >> >> if(key == 'a' || key == 'z') //update the camera >> { >> // Update Rotation angles (clamp the X rotation) >> fAngle = fAngularVelocityX + pCamera.orientation[0]; >> >> if((fAngle < 90.0f) && (fAngle > -90.0f)) >> pCamera.orientation[0] = fAngle; >> >> // Refresh the Window >> glutPostRedisplay(); >> } >> } >> >> void SpecialKeys(int key, int x, int y) >> { >> float fLinearVelocity=1; >> float fAngularVelocityY=0; >> int speed; >> if(gofast) >> speed=10; >> else >> speed=1; >> if(key == GLUT_KEY_UP) //go forward >> fLinearVelocity= 5.0f*speed; >> >> if(key == GLUT_KEY_DOWN) //go backward >> fLinearVelocity= -5.0f*speed; >> >> if(key == GLUT_KEY_LEFT) //turn to the left >> fAngularVelocityY = -5.0f*speed; >> >> if(key == GLUT_KEY_RIGHT) //turn to the right >> fAngularVelocityY = 5.0f*speed; >> >> pCamera.orientation[1] += fAngularVelocityY; >> >> // Update linear position >> pCamera.position[0] = fLinearVelocity * >> (float)(sin(DEGTORAD(pCamera.orientation[1]))) + pCamera.position[0]; >> pCamera.position[2] = fLinearVelocity * >> (float)(cos(DEGTORAD(pCamera.orientation[1]))) + pCamera.position[2]; >> >> // Refresh the Window >> glutPostRedisplay(); >> } >> >> // Setup the rendering state >> void SetupRC(void) >> { >> glEnable(GL_DEPTH_TEST); // Hidden surface removal >> >> // Set clear color to blue >> glClearColor(0.0f, 0.0f, 1.0f, 1.0f); >> >> // Camera initial position and orientation >> // Initially at Origin >> cameraData.position[0] = 0.0f; >> cameraData.position[1] = 0.0f; >> cameraData.position[2] = 0.0f; >> >> // Looking down negative Z Axis (North). Positive X is to the right >> cameraData.orientation[0] = 0.0f; >> cameraData.orientation[1] = 0.0f; >> cameraData.orientation[2] = 0.0f; >> } >> >> /*void moving_mouse (int x, int y) >> { >> int tempx,tempy; >> tempx=-x/(window_width/20) + window_width/20; >> tempy=(window_hieght-y); >> }*/ >> >> void MouseHandler(int button, int state, int x, int y) //if they >> clicked somewhere start making a new wall or finish a wall >> { >> int tempx,tempy; >> if(button == GLUT_LEFT && state == GLUT_DOWN) >> { >> tempx=-sin(DEGTORAD(x))*(window_hieght); >> tempy=cos(DEGTORAD(y))*(window_width); >> walls.push_back(tempx); >> walls.push_back(tempy); >> if(walls.size()%4==0) >> glutPostRedisplay(); >> glutMouseFunc(MouseHandler); >> } >> } >> >> void motion(int x, int y) //does the same thing as mousehandler, but >> it changes the current point they are doing, and if nothing has been >> clicked it marks the first click as the first point and then after as >> the finial point. >> { >> int tempx,tempy; >> tempx=-sin(DEGTORAD(x))*(window_hieght); >> tempy=cos(DEGTORAD(y))*(window_width); >> >> if(walls.size()%4==0) >> { >> walls[walls.size()-2]=tempx; >> walls[walls.size()-1]=tempy; >> glutPostRedisplay(); >> } >> else >> { >> walls.push_back(tempx); >> walls.push_back(tempy); >> } >> } >> >> // Called by GLUT library when the window has chanaged size >> void ChangeSize(GLsizei w, GLsizei h) >> { >> float fAspect; >> >> window_width=w; >> window_hieght=h; >> // Prevent a divide by zero >> if(h == 0) >> h = 1; >> >> // Set Viewport to window dimensions >> glViewport(0, 0, w, h); >> >> // Reset coordinate system >> glMatrixMode(GL_PROJECTION); >> glLoadIdentity(); >> >> fAspect = (float)w/(float)h; >> gluPerspective(45.0,fAspect, 1.0, 500.0); >> glMatrixMode(GL_MODELVIEW); >> glLoadIdentity(); >> } >> >> // Main program entry point >> void main(void) >> { >> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); >> glutCreateWindow("Broken Metal"); >> glutDisplayFunc(RenderScene); >> //glutFullScreen(); >> glutKeyboardFunc(Keys); >> glutSpecialFunc(SpecialKeys); >> glutReshapeFunc(ChangeSize); >> glutMotionFunc(motion); >> glutMouseFunc(MouseHandler); >> glutPassiveMotionFunc(moving_mouse); >> SetupRC(); >> >> glutMainLoop(); >> } >> >> >> >> ------------------------------------------------------------------------ >> >> /* >> gcc -Wall -lglut -lGLU -lGL unproject.c -o unproject >> */ >> >> #include <GL/glut.h> >> >> void Display(); >> void Reshape(int w,int h); >> void Mouse(int button,int state,int x,int y); >> >> int main(int argc,char **argv) { >> glutInit(&argc,argv); >> glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); >> glutInitWindowSize(500,500); >> glutInitWindowPosition(100,100); >> glutCreateWindow(argv[0]); >> glutDisplayFunc(Display); >> glutReshapeFunc(Reshape); >> glutMouseFunc(Mouse); >> >> glEnable(GL_LIGHTING); >> glEnable(GL_LIGHT0); >> glEnable(GL_DEPTH_TEST); >> >> glutMainLoop(); >> return 0; >> } >> >> GLdouble ox=0.0,oy=0.0,oz=0.0; >> void Display() { >> glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); >> glLoadIdentity(); >> gluLookAt(10.0,0.0,20.0,0.0,0.0,0.0,0.0,1.0,0.0); >> >> glPushMatrix(); >> glRotatef(45,1.0,0.0,0.0); >> glutSolidTorus(4.0,5.0,20,20); >> glPopMatrix(); >> >> glPushMatrix(); >> glDepthMask(GL_FALSE); >> glTranslated(ox,oy,oz); >> glutSolidSphere(0.5,15,15); >> glDepthMask(GL_TRUE); >> glPopMatrix(); >> >> glFlush(); >> } >> >> void Reshape(int w,int h) { >> glViewport(0,0,w,h); >> glMatrixMode(GL_PROJECTION); >> glLoadIdentity(); >> gluPerspective(45.0,(float)w/(float)h,5.0,30.0); >> glMatrixMode(GL_MODELVIEW); >> } >> >> void Mouse(int button,int state,int x,int y) { >> GLint viewport[4]; >> GLdouble modelview[16],projection[16]; >> GLfloat wx=x,wy,wz; >> >> if(state!=GLUT_DOWN) >> return; >> if(button==GLUT_RIGHT_BUTTON) >> exit(0); >> glGetIntegerv(GL_VIEWPORT,viewport); >> y=viewport[3]-y; >> wy=y; >> glGetDoublev(GL_MODELVIEW_MATRIX,modelview); >> glGetDoublev(GL_PROJECTION_MATRIX,projection); >> glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&wz); >> gluUnProject(wx,wy,wz,modelview,projection,viewport,&ox,&oy,&oz); >> glutPostRedisplay(); >> } > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > ISUGameDev-devel mailing list > ISU...@li... > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > |
From: Chad A. <ae...@vr...> - 2003-05-26 08:01:00
|
Ian Overton wants to convert screen coordinates to coordinates on a grid that he has drawn (with perspective). I've never used gluUnProject before... Can someone help him? Thanks, Chad Ian Overton wrote: > Alright I want to figure out how to take the mouse coords and convert them to > something on the x z plane. I have made a grid and I want to be able to click > on the grid and know exactly where that click was on that grid, so I will be > able to make a wall. Problem is I have no idea how to do it, cause of the > prespective and I've looked everywhere and they don't seem to know either. My > code is in the broken_metal file. > > I have also found something that does kind of what I want, but when I try and > do it to the grid it always gives huge numbers and it seems it does that on > that unproject to, but yet it works. I don't know, can check it out and see if > you can figure it out? > > I believe > glGetIntegerv(GL_VIEWPORT,viewport); > y=viewport[3]-y; > wy=y; > glGetDoublev(GL_MODELVIEW_MATRIX,modelview); > glGetDoublev(GL_PROJECTION_MATRIX,projection); > glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&wz); > gluUnProject(wx,wy,wz,modelview,projection,viewport,&ox,&oy,&oz); > > is the meat and patatos I don't really need to use glreadpixel, because I only > need two of the three coords. The y coord is -10 > > > > ------------------------------------------------------------------------ > > // GLRect.c > // The Drawing a simple 3D rectangle program with GLUT > // OpenGL SuperBible, 2nd Edition > // Richard S. Wright Jr. > > #include <windows.h> > #include <gl/glut.h> > #include <vector> > #include <math.h> > > #define DEGTORAD(x) ((x)*0.017453292519943296) > > std::vector<int> walls; > bool gofast=0; > int window_width=0; > int window_hieght=0; > > struct CAMERA > { > float position[3]; > float orientation[3]; > } cameraData; > > CAMERA pCamera; > // Called to draw scene > void RenderScene(void) > { > // Clear the window with current clearing color > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); > > // Save matrix state and do the rotation > glPushMatrix(); > glRotatef(pCamera.orientation[0], 1.0f, 0.0f, 0.0f);//turn and move the camera to the rigth place > glRotatef(pCamera.orientation[1], 0.0f, 1.0f, 0.0f); > glRotatef(pCamera.orientation[2], 0.0f, 0.0f, 1.0f); > glTranslatef(-pCamera.position[0],pCamera.position[1],pCamera.position[2]); > > glBegin(GL_LINES); > glColor3f(0.0f, 1.0f, 1.0f); > > for(int y=-500; y<=500; y+=5) //make a grid > { > glVertex3i(y,-10,-500); > glVertex3i(y,-10,500); > glVertex3i(-500,-10,y); > glVertex3i(500,-10,y); > } > > glLoadIdentity(); > glColor3f(1.0f, 1.0f, 1.0f); > if(!walls.empty()) > { > for(y=0; y<walls.size(); y+=4)//plot my points I made with the mouse > { > glVertex3i(walls[y],-1,walls[y+1]); > glVertex3i(walls[y+2],-1,walls[y+3]); > } > } > glEnd(); > > // Restore transformations > glPopMatrix(); > > glutSwapBuffers(); > } > > void Keys(unsigned char key, int x, int y) > { > float fAngularVelocityX,fAngle; > if(key == 'a') > fAngularVelocityX = -5.0f; //look up > > if(key == 'z') > fAngularVelocityX = 5.0f; //look down > > if(key == 0x1b)//esc quit > exit(0); > > if(key == 'r' && !gofast) //run > gofast=1; > else > gofast=0; > > > if(key == 'a' || key == 'z') //update the camera > { > // Update Rotation angles (clamp the X rotation) > fAngle = fAngularVelocityX + pCamera.orientation[0]; > > if((fAngle < 90.0f) && (fAngle > -90.0f)) > pCamera.orientation[0] = fAngle; > > // Refresh the Window > glutPostRedisplay(); > } > } > > void SpecialKeys(int key, int x, int y) > { > float fLinearVelocity=1; > float fAngularVelocityY=0; > int speed; > if(gofast) > speed=10; > else > speed=1; > if(key == GLUT_KEY_UP) //go forward > fLinearVelocity= 5.0f*speed; > > if(key == GLUT_KEY_DOWN) //go backward > fLinearVelocity= -5.0f*speed; > > if(key == GLUT_KEY_LEFT) //turn to the left > fAngularVelocityY = -5.0f*speed; > > if(key == GLUT_KEY_RIGHT) //turn to the right > fAngularVelocityY = 5.0f*speed; > > pCamera.orientation[1] += fAngularVelocityY; > > // Update linear position > pCamera.position[0] = fLinearVelocity * (float)(sin(DEGTORAD(pCamera.orientation[1]))) + pCamera.position[0]; > pCamera.position[2] = fLinearVelocity * (float)(cos(DEGTORAD(pCamera.orientation[1]))) + pCamera.position[2]; > > // Refresh the Window > glutPostRedisplay(); > } > > // Setup the rendering state > void SetupRC(void) > { > glEnable(GL_DEPTH_TEST); // Hidden surface removal > > // Set clear color to blue > glClearColor(0.0f, 0.0f, 1.0f, 1.0f); > > // Camera initial position and orientation > // Initially at Origin > cameraData.position[0] = 0.0f; > cameraData.position[1] = 0.0f; > cameraData.position[2] = 0.0f; > > // Looking down negative Z Axis (North). Positive X is to the right > cameraData.orientation[0] = 0.0f; > cameraData.orientation[1] = 0.0f; > cameraData.orientation[2] = 0.0f; > } > > /*void moving_mouse (int x, int y) > { > int tempx,tempy; > tempx=-x/(window_width/20) + window_width/20; > tempy=(window_hieght-y); > }*/ > > void MouseHandler(int button, int state, int x, int y) //if they clicked somewhere start making a new wall or finish a wall > { > int tempx,tempy; > if(button == GLUT_LEFT && state == GLUT_DOWN) > { > tempx=-sin(DEGTORAD(x))*(window_hieght); > tempy=cos(DEGTORAD(y))*(window_width); > walls.push_back(tempx); > walls.push_back(tempy); > if(walls.size()%4==0) > glutPostRedisplay(); > glutMouseFunc(MouseHandler); > } > } > > void motion(int x, int y) //does the same thing as mousehandler, but it changes the current point they are doing, and if nothing has been clicked it marks the first click as the first point and then after as the finial point. > { > int tempx,tempy; > tempx=-sin(DEGTORAD(x))*(window_hieght); > tempy=cos(DEGTORAD(y))*(window_width); > > if(walls.size()%4==0) > { > walls[walls.size()-2]=tempx; > walls[walls.size()-1]=tempy; > glutPostRedisplay(); > } > else > { > walls.push_back(tempx); > walls.push_back(tempy); > } > } > > // Called by GLUT library when the window has chanaged size > void ChangeSize(GLsizei w, GLsizei h) > { > float fAspect; > > window_width=w; > window_hieght=h; > // Prevent a divide by zero > if(h == 0) > h = 1; > > // Set Viewport to window dimensions > glViewport(0, 0, w, h); > > // Reset coordinate system > glMatrixMode(GL_PROJECTION); > glLoadIdentity(); > > fAspect = (float)w/(float)h; > gluPerspective(45.0,fAspect, 1.0, 500.0); > glMatrixMode(GL_MODELVIEW); > glLoadIdentity(); > } > > // Main program entry point > void main(void) > { > glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); > glutCreateWindow("Broken Metal"); > glutDisplayFunc(RenderScene); > //glutFullScreen(); > glutKeyboardFunc(Keys); > glutSpecialFunc(SpecialKeys); > glutReshapeFunc(ChangeSize); > glutMotionFunc(motion); > glutMouseFunc(MouseHandler); > glutPassiveMotionFunc(moving_mouse); > > SetupRC(); > > glutMainLoop(); > } > > > > ------------------------------------------------------------------------ > > /* > gcc -Wall -lglut -lGLU -lGL unproject.c -o unproject > */ > > #include <GL/glut.h> > > void Display(); > void Reshape(int w,int h); > void Mouse(int button,int state,int x,int y); > > int main(int argc,char **argv) { > glutInit(&argc,argv); > glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); > glutInitWindowSize(500,500); > glutInitWindowPosition(100,100); > glutCreateWindow(argv[0]); > glutDisplayFunc(Display); > glutReshapeFunc(Reshape); > glutMouseFunc(Mouse); > > glEnable(GL_LIGHTING); > glEnable(GL_LIGHT0); > glEnable(GL_DEPTH_TEST); > > glutMainLoop(); > return 0; > } > > GLdouble ox=0.0,oy=0.0,oz=0.0; > void Display() { > glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); > glLoadIdentity(); > gluLookAt(10.0,0.0,20.0,0.0,0.0,0.0,0.0,1.0,0.0); > > glPushMatrix(); > glRotatef(45,1.0,0.0,0.0); > glutSolidTorus(4.0,5.0,20,20); > glPopMatrix(); > > glPushMatrix(); > glDepthMask(GL_FALSE); > glTranslated(ox,oy,oz); > glutSolidSphere(0.5,15,15); > glDepthMask(GL_TRUE); > glPopMatrix(); > > glFlush(); > } > > void Reshape(int w,int h) { > glViewport(0,0,w,h); > glMatrixMode(GL_PROJECTION); > glLoadIdentity(); > gluPerspective(45.0,(float)w/(float)h,5.0,30.0); > glMatrixMode(GL_MODELVIEW); > } > > void Mouse(int button,int state,int x,int y) { > GLint viewport[4]; > GLdouble modelview[16],projection[16]; > GLfloat wx=x,wy,wz; > > if(state!=GLUT_DOWN) > return; > if(button==GLUT_RIGHT_BUTTON) > exit(0); > glGetIntegerv(GL_VIEWPORT,viewport); > y=viewport[3]-y; > wy=y; > glGetDoublev(GL_MODELVIEW_MATRIX,modelview); > glGetDoublev(GL_PROJECTION_MATRIX,projection); > glReadPixels(x,y,1,1,GL_DEPTH_COMPONENT,GL_FLOAT,&wz); > gluUnProject(wx,wy,wz,modelview,projection,viewport,&ox,&oy,&oz); > glutPostRedisplay(); > } |
From: Chad A. <ae...@vr...> - 2003-04-14 10:06:46
|
This technique (recently posted on flipCode) lets you ignore the order of objects you draw with transparency. It uses a shader to draw with correct translucency no matter what order you draw in! http://developer.nvidia.com/view.asp?IO=Interactive_Order_Transparency |
From: Chad A. <ae...@vr...> - 2003-04-03 23:05:13
|
Check this out... http://sourceforge.net/projects/stepmania/ 64 developers! 1,000+ total bug reports! 10,000 CVS commits! I never would have thought DDR has attracted so many developers. |
From: Josh B. <br...@vr...> - 2003-03-13 19:50:10
|
Thanks, your awesome J On Thu, 13 Mar 2003, Chad Austin wrote: > Go into your project settings and link with OpenGL32.lib and GLU32.lib as well. > > Josh Brown wrote: > > I'm developing on windows again for the first time in around a year and I > > seem to have forgotten everything about win32. I'm working in vc6 at home > > and am using sdl for an opengl app. I am also using corona for image > > handleing. I include SDL_opengl.h for opengl support but when I build I > > get a bunch of link errors and all the gl functions are undefined :( Any > > ideas to what cold be wrong??? > > > > > > thanks > > josh > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by:Crypto Challenge is now open! > > Get cracking and register here for some mind boggling fun and > > the chance of winning an Apple iPod: > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > > _______________________________________________ > > ISUGameDev-devel mailing list > > ISU...@li... > > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > > > |
From: Chad A. <ae...@vr...> - 2003-03-13 19:45:22
|
Go into your project settings and link with OpenGL32.lib and GLU32.lib as well. Josh Brown wrote: > I'm developing on windows again for the first time in around a year and I > seem to have forgotten everything about win32. I'm working in vc6 at home > and am using sdl for an opengl app. I am also using corona for image > handleing. I include SDL_opengl.h for opengl support but when I build I > get a bunch of link errors and all the gl functions are undefined :( Any > ideas to what cold be wrong??? > > > thanks > josh > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > ISUGameDev-devel mailing list > ISU...@li... > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel |
From: Josh B. <br...@vr...> - 2003-03-13 19:36:57
|
I'm developing on windows again for the first time in around a year and I seem to have forgotten everything about win32. I'm working in vc6 at home and am using sdl for an opengl app. I am also using corona for image handleing. I include SDL_opengl.h for opengl support but when I build I get a bunch of link errors and all the gl functions are undefined :( Any ideas to what cold be wrong??? thanks josh |
From: Chad A. <ae...@vr...> - 2003-03-13 18:54:01
|
This is a pretty interesting engine. http://irrlicht.sourceforge.net/ I'm looking forward to future releases. |
From: Chad A. <ae...@vr...> - 2003-03-09 22:14:44
|
This link can help you get out of writer's block. http://www.sff.net/people/julia.west/CALLIHOO/dtbb/ideagen2.htm |
From: Andrew S. <zo...@bl...> - 2003-02-05 20:19:54
|
please have the list admin remove me from the list, apparently trying to unsubscribe myself tells me that my email address is not in the list. There maybe be a slightly misspelled version since my email address is a catch all. please remove: zo...@bl... or any other address that has @bludeye.com thanks |
From: Lou H. <lh...@ia...> - 2003-02-05 17:46:45
|
Remember the way that stacks work-- Last-in - First-out. So, you push your translations before your rotations, so that when you pop them back off, the program sees rotations and then translations. That's my $0.02 - Lou ----- Original Message ----- From: "Sean Stanek" <vu...@cs...> To: <isu...@li...> Sent: Tuesday, February 04, 2003 10:11 PM Subject: Re: [isugamedev-devel] OpenGL rotations > > Sounds like you're drawing the cube off-center and then rotating the > off-center cube. What you really want is to draw the cube centered with > the "camera," then rotate it, and then translate it out so that you can > see it (otherwise you'd be inside it :). Of course when you use OpenGL you > have to specify transformations BEFORE you draw, so keep this in mind > while you code your transformations (glRotate/glTranslate should be > sufficient). If you get what you're getting right now, you can *probably* > (depends on how you're doing it for the "probably" to work) just switch > around your glRotate and glTranslate and make it work. > > Sean > > > Okay, I'm just trying to get a little more practice programming 3D with > > OpenGL and SDL. In Ben's tutorial last semester there was a spinning cube > > that you could look at using the mouse and arrow keys. I'm trying to change > > this a bit, and I have a problem. Whenever I move my mouse, it seems to be > > rotating the cube around me, and that's really not what I want. I just want > > to "look" somewhere else. I want the cube to stay rotating in it's own > > original space. Can anyone help? Thanks! > > > > Jacob > > > > > > > > _________________________________________________________________ > > MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. > > http://join.msn.com/?page=features/virus > > > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: > > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > > http://www.vasoftware.com > > _______________________________________________ > > ISUGameDev-devel mailing list > > ISU...@li... > > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > > > > -- > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > ISUGameDev-devel mailing list > ISU...@li... > https://lists.sourceforge.net/lists/listinfo/isugamedev-devel > |