Jump to content
xisto Community

t3jem1405241533

Members
  • Content Count

    48
  • Joined

  • Last visited

Everything posted by t3jem1405241533

  1. I apologize for placing this topic in the wrong category; however, I could not find one that would match this thread closer.ok, on to my post.A while ago I had posted a series of tutorials here at Xisto for programming in GLUT. Since then I have moved to Xisto and have wanted to continue my series; however, I was told that I was unable to just copy my tutorials over there and since I wasn't thinking clearly I had forgotten to ask if I could move them there. So my question now is if I'm allowed to move my tutorials over to Xisto as long as I delete them here at Xisto?Please reply in email or instant message as I rarely watch these forums anymore.my email is: t3jem3@gmail.comthank you in advance.
  2. That was very entertaining. I would love to get vista, but I doubt my computer would run it well so I will wait until I get my next laptop. Thanks for showing this to me though, very funny.
  3. Wow, I knew some cities had already started the network thing but I didn't realize you could use printers and scanners too. It's amazing how far we are advancing in technology in this past decade alone!
  4. I was reading the news last night when I saw an article about the worlds largest wireless network. Houston, Texas is planning to create a $50 million wireless network covering about 600 square miles. The fees to use it will be as low as $10 and free in some parks and libraries. They are also starting an organization to help people buy laptops they otherwise could not afford. I found this very interesting and very neat how we are moving into the future of connecting everyone into the internet. Los Angeles California is doing the same thing, but they are only covering about 400 square miles and are due to finish 2011. I think this is a great way to help people get connected and can't wait till it is finished, I don't know where they are getting the money because the mayor said it wasn't coming from the tax payers, but I'm sure they'll find some way to pay for it. Thought this might interest some people here.
  5. Which console are you asking about? I have it for the Wii and I must say that it is very fun to play. It has many settings and if you have the weather channel updated you can even put the current weather into your matches. You can customize everything from your playbook and plays to your players and teams. I think it is definitly worth the $50 to go and get it. It takes a little while to learn, but after that it's a blast.
  6. This sounds like a good idea. I just thought I would let you know that you don't really need too much money, you probably only need to do some research and figure out how to make just one proto type or a schematic. Then you would just need someone to look at the research you've done and convince them that it would be worth investing in it. When you go to solicit some help I would suggest having the target consumers, pricing, schematics, and possibly cost to build in mind. The more research you put into your product the more likely the person will believe weather or not it is worth investing in it. Well hope this idea works, if I see them on the market I may buy a set.
  7. I have wireless internet at around $60 a month, but its only a little better than dial up with about a 30% packet loss. I am definitly getting ripped off, but unfortunatly it's the best our here at the moment, though we may be moving to satellite soon.
  8. I understand this policy and why it has been set into action; however, it is my belief that you should still be able to sell your ingame items for real money. I don't think its smart to buy ingame items with real money; however, I don't oppose it. Someone still worked to get the ingame items and for some its a second source of income. Just because it is a game doesn't mean that the items are worthless, the economy is driven by supply and demand, if someone demands ingame items and is will to buy with real money, its likely someone will supply it, it's a new market now with online games. I definitly do not think Ebay's new policy will help much except maybe discourage a few more people, but there will always be selling of ingame items.
  9. Well, first of all I just thought I'd point out how your trying to think of a "Killer Headline" for your book of Killer Headlines just thought that was funny. I think, out of those three I would most likely pick up the book "106 Killer Headlines" Its short simple and to the point.
  10. very cool, fiber optic on wireless is just what I need, if I had a server computer with a T1 internet connection that is. It's amazing how far we are advancing in the last few years. To Organicbmx, I think you need a line of sight not because it uses laser, but because walls or anything in the way may interfere with the signal. Same thing with my broadband connection, I need line of sight, but it still uses radio signals.
  11. Very interesting,if this works out correctly it seems we could have smaller batteries that last even longer it sounds like. Of course you always have to worry about them destroying everything in their path, but if that doesn't happen this could be yet another breakthrough in the era we live in today.
  12. I think Dell is a pretty good brand, they have good prices, but I think the only real downfall is that they put 3GB of trials on your comp so you have to uninstall them all when you get your comp, but other than that, i have had no problems with any of my Dell computers. They can even help you order the computer you want and guide through what hardware you would need.
  13. Alright, well seeing as my computer doesn't support hardware transformations anyways, i think its safe to say that i'm not going to be playing any games with directx 10; therefor, no reason for me to get vista until i get a new computer. Thanks for the info, helped alot
  14. Iv heard many things about vista and am not sure if Vista is good or not. The ready boost feature sound very good, but i'v heard it doesn't help that much. I also have heard that games don't run faster on Vista, though I have also heard they do. Can anybody confirm weather or not they truly do run better or not? I have also heard that it turns off all non essential programs off while playing games to run them smoother, just some rumors i'v heard, i'd post another thread but i saw one just get shut down because there were already too many threads about vista.
  15. It all depends on your what your good at. I would definitly not encourage you to go into a field you do not like either. I would look into which feilds interest me then study in that feild. Most computer feilds pay a decent amount of money anyways. I personally am going into programming, not sure what programming yet, but I prefer programming computers rather than making them, so look around find what you like and go for it.
  16. this sounds really neat, I do think that if the prices went down enough they could definitly revolutionize technology. I would definitly buy a screen I could roll up and pin on the wall too . This sound very neat, I hope that they become available to the public soon.
  17. I think the most important aspect of a user interface is the ease of use. For end users the easier it is to use the more they are going to like it. It has to be easy to use and very efficient to get people realy like the user interface. I would not like a UI if it lagged my computer down a whole lot even if it was really easy to use. Just my two cents
  18. well a very popular one is runescape. Its been around for quite a few years, its got free play and pay to play. The pay to play has more features, but the free one is still very entertaining. I used to play until i realized I was playing way too much so i quit. There is over 150 thousand people playing at any given time and does have good graphics for being a web based game. Its nothing like world of warcraft for everquest, but you can't compete with those since they cost so much. Even the payed version of runescape is cheap (only 5 US dollars a month). It has many missions or quests you can partake in or you can just level your character up. Another major plus is that it updates a few times a month so there is always new features coming out. Its very interactive with other people, but you can go play by yourself. For player to player combat you can go into the "wilderness" and fight with other people, but beware because there are some people who make it a sport to just kill whoever they see. I think this is probably the best mmorpg you will find for free. You don't even have to install anything, unless you don't have java. I hope this helps.
  19. gmail does sound like the best free email service; however, with hotmail's new live mail you can get 2GB for free and its a very user friendly interface. The downside is its large size. The only major flaw I can see in Gmail is that its not really entirely free since you have to wait for an invite. With hotmail you can just sign up for it, this is probably why I don't use Gmail, because I don't know anyone who does so I can't get invites, just thought i'd bring it up.
  20. Myspace is not that great, but that is the only site my friends use so thats the only reason i keep it. There are many "fake" people on there and that's why i only add people i know in person. I can see how easy it would be for someone to get personal information on someone though because most teens these days don't see how important it is to keep private information private. It is also hard to customize your profile, you have to have some knowledge of web programming to make it look good even with the generators.
  21. iv used both internet explorer 7 and firefox 2, i heard that firefox is more secure than ie; however, i have found that ie displays my website quite nicely while firefox makes it look like trash. i do like how firefox colors the code with the "show source" feature which i find helpful in some situations.
  22. im not so sure of robot technology being the newest technology of 2007 because i don't see many robots walking down the streets. i would probably expect something more like the graphics or computer power we have now as the new technology. not many people are out buying robots; however the new gaming consoles were sold out for months i would defenetly have something about that in there. possibly even the new multicore processors and terrabyte harddrives. just my suggestion, hope it helps.
  23. ok, I wanted to put it all in one so if people didn't want to read they could just copy and paste into their compiler and learn later, but yea thats a good idea, I can get that done, I'll probably do that some time this week though its pretty busy here, thanks for the tip though
  24. This tutorial demonstrates how to use texture filters and will let you see the differences of each filter. I will also be introducing lighting into this tutorial. We first have to create our "bitmap.h" header file with the functions we use to load our bitmaps, this is changed from the last tutorial to fit the needs of this one. The first thing to do is to link all of our OpenGL libraries and include our needed headers for the functions we will call. #pragma comment(lib, "opengl32.lib")//Link to the OpenGL libraries#pragma comment(lib, "glu32.lib")#pragma comment(lib, "glaux.lib")#include <windows.h> // Header File For Windows#include <gl\gl.h> // Header File For The OpenGL32 Library#include <gl\glu.h> // Header File For The GLu32 Library#include <gl\glaux.h> // Header File For The Glaux Library Next we define our first function with the same three arguments as the last tutorial (The texture array, file location, and place in array). This functon is going to load a linear filtered texture into our program. I will talk more about linear texturing in a little bit. bool linearbmp(UINT textureArray[], LPSTR strFileName, int ID)//define our arguments{ First, we want to make sure a file name was given, if it wasnt we return a false value to let the program know it failed, if a filename was given then we load our file into a new variable which we will use to manipulate the data into a readable format by our program. if(!strFileName) return false;//check for a filename AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); //Load our fileIf there was no data loaded (usually in case of a false filename) then we exit the program if(pBitMap == NULL) exit(0);// If no data was loaded then exit the program.Now that we are done with all of our error checking we generate our texture and place it into our texture array; however, we are not done yet. glGenTextures(1, &textureArray[ID]);//Generate our textureNext we have to bind our texture to texture targets. Texture targets are just polygons that use the glVertex command. glBindTexture(GL_TEXTURE_2D, textureArray[ID]);//bind our texture to texture targets now for our filtering. We want to set our filtering in this function to use Linear filtering. Linear filtering will resize the image to the size needed throughout runtime, this uses the most CPU, but generates the best effect. We set linear filtering twice because the second argument in the function defines when we want to use the filter, "GL_TEXTURE_MIN_FILTER" is telling the program to use the set filter when the texture is near "...MAG_FILTER" tells the program to use the set filter when the texture is far. glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);//set linear filtering glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);//set linear filtering now we finally finish the creation of our texture. The first argument tells the function we are using a 2D image, the second is the detail of the image (usually set to 0), the third is how many components are in use (red, green, blue), the fourth and fifth tell the application to find the size of the image itself (you can substitute for the actual size if you want, but it reduces compatibility with other images), the sixth argument is the size of the border, then we tell the application the type of image we are using (red, green, blue), then we let it know the data is in unsigned bytes, then we tell it where to get the data. glTexImage2D(GL_TEXTURE_2D, 0, 3, pBitMap->sizeX, pBitMap->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data);//create our texture then we need to clear our variable to preven memory leaks if (pBitMap) //If pBitMap still has a value then we want to clear it. { if (pBitMap->data) { free(pBitMap->data); } free(pBitMap); } return true;} now we need to define our new function that will load images with the nearest filter. bool nearestbmp(UINT textureArray[], LPSTR strFileName, int ID)//define our new function{ First, we want to make sure a file name was given, if it wasnt we return a false value to let the program know it failed, if a filename was given then we load our file into a new variable which we will use to manipulate the data into a readable format by our program. if(!strFileName) return false;//check for a filename AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); //Load our fileIf there was no data loaded (usually in case of a false filename) then we exit the program if(pBitMap == NULL) exit(0);// If no data was loaded then exit the program.Now that we are done with all of our error checking we generate our texture and place it into our texture array; however, we are not done yet. glGenTextures(1, &textureArray[ID]);//Generate our textureNext we have to bind our texture to texture targets. Texture targets are just polygons that use the glVertex command. glBindTexture(GL_TEXTURE_2D, textureArray[ID]);//bind our texture to texture targets now for our filtering. We want to set our filtering in this function to use nearest filtering. the nearest filtering setting uses the least amount of CPU, but begins to become pixelized when brought closer to the screen. glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);//set linear filtering glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);//set linear filtering now we finally finish the creation of our texture. The first argument tells the function we are using a 2D image, the second is the detail of the image (usually set to 0), the third is how many components are in use (red, green, blue), the fourth and fifth tell the application to find the size of the image itself (you can substitute for the actual size if you want, but it reduces compatibility with other images), the sixth argument is the size of the border, then we tell the application the type of image we are using (red, green, blue), then we let it know the data is in unsigned bytes, then we tell it where to get the data. glTexImage2D(GL_TEXTURE_2D, 0, 3, pBitMap->sizeX, pBitMap->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data);//create our texture then we need to clear our variable to preven memory leaks if (pBitMap) //If pBitMap still has a value then we want to clear it. { if (pBitMap->data) { free(pBitMap->data); } free(pBitMap); } return true;} We now define our function that will load mipmap images, it has the same arguments as the previous two functions. bool mipmapbmp(UINT textureArray[], LPSTR strFileName, int ID)//define our function{First, we want to make sure a file name was given, if it wasnt we return a false value to let the program know it failed, if a filename was given then we load our file into a new variable which we will use to manipulate the data into a readable format by our program. if(!strFileName) return false;//check for a filename AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); //Load our fileIf there was no data loaded (usually in case of a false filename) then we exit the program if(pBitMap == NULL) exit(0);// If no data was loaded then exit the program.Now that we are done with all of our error checking we generate our texture and place it into our texture array; however, we are not done yet. glGenTextures(1, &textureArray[ID]);//Generate our textureNext we have to bind our texture to texture targets. Texture targets are just polygons that use the glVertex command. glBindTexture(GL_TEXTURE_2D, textureArray[ID]);//bind our texture to texture targets our filter for textures far from the camera will still be linear; however, when they are closer to the camera we will use mipmapping. Mipmapping loads the image then resizes it into lots of different sizes and during runtime decides which texture to use. This is the most efficient filter for the quality. Mipmapping also eliminates the need for the width and height of the image to be a power of two. glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);//set linear filter glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); //(NEW) set mipmapping filter and next we have to create our texture, the next function is much like glTexImage2d except that it creates the different textures needed for the mipmapping, it has all of the same arguments except for the detail argument which is ommited. gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pBitMap->sizeX, pBitMap->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data); //(NEW)create our mipmap texture then we need to clear our variable to preven memory leaks if (pBitMap) //If pBitMap still has a value then we want to clear it. { if (pBitMap->data) { free(pBitMap->data); } free(pBitMap); } return true;} The next section of code is the main body of the program. we start by loading our header files, we need to load our bitmap.h file to so we can use the functions defined in it #include<glut.h>#include"bmpload.h"//Load the header file we created above next we create an array to hold 3 textures, 1 for each filter. We then create a rotation variable and speed variable to keep track of the cube's spin and speed, lastly we initialize a variable to keep track of which filter we are using. GLuint textures[3];//create our texture arrayfloat rotation = 0;//initialize rotation variablefloat rotspeed = 0;//initialize speed variableint filter=0;//(NEW) initialize filter variable now we create our init function that will initialize our opengl settings, it will also include the lighting settings. void init(){ we need to create three arrays. Each array will hold a different value for our light. The first array will define the ambient color, this is the color the object will look, we have to use this setting instead of glcolor3f(), but to define the colors for all light values it is the same. The second array will define the diffuse color, this is the color of the bright areas of the object or the color of the light. The last array is the position of the light, this is the same as glVertex3f, but it has an added variable in it which should just be set to 1. GLfloat ambient[]= {0.5f,0.5f,0.5f,1.0f}; // (NEW) define the object color GLfloat diffuse[]= {1.0f,1.0f,1.0f,1.0f}; // (NEW) define the light color GLfloat position[]= {10,5,-5,1}; // (NEW) set the light position next we have to put our settings into effect. We have to initialize our settings with the glLightfv() function. The first parameter is which light the setting will effect (there are 8 lights), the second argument is the setting to affect and the last is your variable holding the setting. There are five different settings, but we will only go over three in this tutorial. glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); //(NEW) set the ambient value glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); //(NEW) set the diffuse value glLightfv(GL_LIGHT1, GL_POSITION,position); //(NEW) set the position next we have to enable two things, lighting and light1. Enable light1 enables the light we have just set up and enabling lighting enables all lighting. glEnable(GL_LIGHT1);//(NEW) enable light1 glEnable(GL_LIGHTING);//(NEW) enable lighting next we setup our clear color and our screen size. glClearColor(0,0,0,0); glOrtho(-10,10,-10,10,-10,10);//setup screen size. now we load our textures using the functions we created in our "bitmap.h" file. We load our texture with the linear filter, nearest filter, and mipmap filter into our texture array in that order. The we finally enable depth testing and finish with our init function. linearbmp(textures, "image.bmp",0);// (NEW) load a linear texture nearestbmp(textures, "image.bmp",1);// (NEW) load a nearest texture mipmapbmp(textures, "image.bmp",2);// (NEW) load a mipmap texture glEnable(GL_DEPTH_TEST);//3D objects require depth testing to be on} now we start writing our display function which will draw all our objects to the screen. As always we will start by clearing the screen. void display(){ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);//clear the screen next we enable texturing and then bind the texture we want based on the filter selected. glEnable(GL_TEXTURE_2D);//Enable 2D texturing glBindTexture(GL_TEXTURE_2D, textures[filter]);//bind our texture Now we create a matrix for our transformation, we will rotate the cube based on the amount of the rotation variable, with this you can watch the light changing on the faces of the cube. glPushMatrix(); glRotatef(rotation, 0.5,-.6,.2);//rotate our cube Next we create our cube. The only difference in creating our cube this time is the glNormal3f() function. This function defines a ray that points outward at a 90 degree angle from the middle of the polygon you are defining it for. glNormal3f() tells the program how to light the polygon depending on its angle to the light, you can use it point by point or you can use one glnormal3f() call per face. For this tutorial we will call it once per face. glBegin(GL_QUADS);// begin drawing our cube glNormal3f(0,0,-1);//(NEW) set our normal glTexCoord2f(0,1); glVertex3f(-4,4,-4); glTexCoord2f(1,1); glVertex3f(4,4,-4); glTexCoord2f(1,0); glVertex3f(4,-4,-4); glTexCoord2f(0,0); glVertex3f(-4,-4,-4); //This is the back face glNormal3f(0,0,1);//(NEW) glTexCoord2f(0,1); glVertex3f(-4,4,4); glTexCoord2f(1,1); glVertex3f(4,4,4); glTexCoord2f(1,0); glVertex3f(4,-4,4); glTexCoord2f(0,0); glVertex3f(-4,-4,4); //This is the left face glNormal3f(-1,0,0);//(NEW) glTexCoord2f(0,1); glVertex3f(-4,4,4); glTexCoord2f(1,1); glVertex3f(-4,4,-4); glTexCoord2f(1,0); glVertex3f(-4,-4,-4); glTexCoord2f(0,0); glVertex3f(-4,-4,4); //This is the right face glNormal3f(1,0,0);//(NEW) glTexCoord2f(0,1); glVertex3f(4,4,4); glTexCoord2f(1,1); glVertex3f(4,4,-4); glTexCoord2f(1,0); glVertex3f(4,-4,-4); glTexCoord2f(0,0); glVertex3f(4,-4,4); //This is the bottom face glNormal3f(0,-1,0);//(NEW) glTexCoord2f(0,1); glVertex3f(-4,-4,4); glTexCoord2f(1,1); glVertex3f(-4,-4,-4); glTexCoord2f(1,0); glVertex3f(4,-4,-4); glTexCoord2f(0,0); glVertex3f(4,-4,4); //This is the top face glNormal3f(0,1,0);//(NEW) glTexCoord2f(0,1); glVertex3f(-4,4,4); glTexCoord2f(1,1); glVertex3f(-4,4,-4); glTexCoord2f(1,0); glVertex3f(4,4,-4); glTexCoord2f(0,0); glVertex3f(4,4,4); glEnd(); now we close our matrix, disable texturing (in good habit to prevent odd effects in future applications), tell the program to draw everything to the screen, tell the program to start drawing again, and finally we add our rotation speed variable to our rotation variable. glPopMatrix(); glDisable(GL_TEXTURE_2D);//disable texturing glFlush(); glutPostRedisplay(); rotation += rotspeed;} next we define our keyboard function which will use keyboard commands to tell the program what to do. void keyboard(unsigned char key, int x, int y){we start our switch statements to tell the program what to do according to the key presses. when we press 'L' or 'R' then it will adjust the speed of the spinning cube. pressing 1-3 will change the filter we use on the cube switch(key)//start are switch statements { case 'L':case'l'://Increase the speed of the spinning cube. rotspeed += 0.05; break; case 'R':case'r'://Increase the speed of the spinning cube rotspeed -= 0.05; break; case '1'://choose the filter using our # keys filter = 0; break; case '2': filter = 1; break; case '3': filter = 2; break; default: break;//Don't do anything if any other keys are pressed }}we now finally finish our program with our main function that has been unchanged. void main(int argc, char ** argv){ glutInit(&argc, argv); glutInitWindowSize(800,600); glutInitWindowPosition(10,50); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH);//Depth buffer required for 3D objects glutCreateWindow("Lesson 6"); init(); glutDisplayFunc(display); glutKeyboardFunc(keyboard);//This tells our program which function to send keyboard events to. glutMainLoop();} There are 7 different lights you can use at once GL_LIGHT1, GL_LIGHT2... You can enable all of them at once. There are a few more settings for lighting, but we will get into that later on in the tutorials. I hope this tutorial was helpful, and if you have any questions feel free to leave a reply.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.