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

OpenGL_Guru

Members
  • Content count

    1982
  • Joined

  • Last visited

Community Reputation

104 Neutral

About OpenGL_Guru

  • Rank
    Contributor
  1. 0 vote down star i have some jsp code that reads in Servlet Context parameters from a web.xml file. these parameters hold database connection information so each time the SID or user/password or servername changes, the programmer doesnt have to go re-code; the user can just change the web.xml file. <context-param> <description>database host</description> <param-name>host</param-name> <param-value>localhost</param-value> </context-param> <context-param> <description>mysql port</description> <param-name>port</param-name> <param-value>1521</param-value> </context-param> <context-param> <description>database name</description> <param-name>database</param-name> <param-value>tips</param-value> </context-param> <context-param> <description>database user name</description> <param-name>user</param-name> <param-value>guest</param-value> </context-param> <context-param> <description>database password</description> <param-name>password</param-name> <param-value>1234</param-value> </context-param> i read in these using this section of bean class code: String host = servletContext.getInitParameter("host"); String port = servletContext.getInitParameter("port"); String databasename = servletContext.getInitParameter("database"); String user = servletContext.getInitParameter("user"); String pass = servletContext.getInitParameter("password"); The Problem: next i want to do the database connection to retrieve some data: Class.forName("oracle.jdbc.driver.OracleDriver"); dbConnection = DriverManager.getConnection(conn_url, user, pass); String conn_url = "jdbc:oracle:thin:@" + host + ":" + port + ":" + databasename; System.out.println("dbconnection: " + conn_url); System.out.println(user + "," + pass); //user = "user"; //pass = "password"; System.out.println(user + "," + pass); At any rate the dbConnection fails: java.sql.SQLException: ORA-01017: invalid username/password; logon denied If i assign directly the values of the string, by un-commenting the 2 lines of code above it works. so what is going on here when assigning them directly then it works fine. I don't get it. Ive rattled my brain all day. Clearly the getConnection looks for 3 Strings. I am at a loss. Any help would be appreciated. thanks...
  2. well its time after 4 or 5 years now to get a new GPU. theres just some thing i need it for, including but not limited to games. i currently have a Geforce 6800. Cost is not an issue really but the limitation that i have is that the power supply has a max output of 350W. i double checked it just a second ago and its -12V / 1A Max +3.3V / 17A Max +12V-A / 18A Max +12V-B / 18A Max Combined +12V-A and +12V-B shall not exceed 336W Continuous output to not exceed 350W. i am looking for the best card i can get as an upgrade to the 6800 without going over the 350W limit. appreciate the suggestions. (btw i have my eye on a few but before i tell you it would interesting to see if someone mentions what i would like). Also i would rather it be NV since i do some linux work too as part of duel boot. thanks..
  3. Quote:Original post by Imtiaz Maybe you meant to do Shapes[i] ? It is rather weird to me that the compiler allows Shape[i] since you aren't overloading [], and furthermore I don't think you can even static overload either. yeah it should have been shapes. i just typed it in wrong. its corrected now :)
  4. i have this struct set up below: #include <vector> using namespace std; struct point { double x; double y; } struct shape { vector<point> vertices; } shape *shapes; now lets assume that i know how many shapes i will need and i allocate memory as such: shapes = new shape[number]; now i would like to push some values onto this. when i do the following below i get a seg fault when i try to push vertices onto a particular variable shape. point vertex; ..... ..... for(int i = 0; i < shapeCount; i++) { for(int j = 0; j < numVertices; j++) { vertex.x = xNumber[j]; vertex.y = yNumber[j]; shapes[i].vertices.push_back(vertex); // this causes a seg fault } } to be recollection i shouldnt have to be allocating any memory for the vector vertices should i? what could cause this to crash?? thanks for your input in advance! [Edited by - OpenGL_Guru on September 11, 2008 11:49:54 PM]
  5. Quote:Original post by Mithrandir Quote:Original post by Prefect Okay, this is getting more interesting... Quote:Original post by OpenGL_Guru [...] The only executive experience he could claim was on that Challenge fiasco where his own final report says the money spent accomplished exactly zero improvement in the schools. And since the original grant proposal was written by a terrorist William Ayers who kept the lead active role in handing out all that money to political cronies instead of helping improve education (the stated goal in the proposal) Obama really wants to make the whole experience disappear from his resume. [...] This fragment also appears almost verbatim in a post on Slashdot (last paragraph). The only difference is that the Slashdot post mentions "that Annenberg Challenge fiasco" and has a footnote at the word "terrorist". And that Slashdot post is by a different author. This smells. Unfortunately Google's index seems a bit slow in finding these things - I really want to know what's going on here. He's an unoriginal troll. Pretty simple, really. Note how he just ignored these posts pointing it out. if you actually ask prefect you will find that those few posts were indeed me. so no i am not a troll as you speak...or can i not post and view on slashdot too? is that a crime?
  6. Quote:Original post by GameDev Doctor Did you even read the last sentence? How can you argue that executive experience is all that matters (and legislative experience is worthless), when you support a nominee who also has no executive experience? John McCain does have executive experience by being the Captain in the Navy where you have to make executive decisions for your fellow troops that could determine whether they live or die. To me and many people who understand the demands of an officer to run a unit and hold them in your very lives is counted as executive experience.
  7. Quote:Original post by Spoonbender Quote:Original post by OpenGL_Guru We dont know what Obama stands for except that he for the most socialist policy that i have ever read...coming just shy to that of marxism. lol.... Just lol.... Someone needs to brush up on his marxism, I think. Obama is not even left-wing, Marx would have hated his guts. He's just slightly less extreme right-wing than McCain. Quote:by the way isn't it nice when people lower your personal rating because they disagree with you? And if you want to spew ignorant nonsense like the above, you shouldn't complain too loudly if someone rates you down (I didn't). Keep in minds the ratings are for being helpful and friendly. What is helpful about spreading your own ignorance? If you truly are that clueless about what marxism is, or for that matter, what Obama stands for, it'd be more helpful to shut up. If I started suggesting on the beginners forum that everyone should use goto's *all over the place* (who needs functions?), that OpenGL is far more up to date and better supported than DirectX, and that C++ is the easiest language to get started with, I think I'd get rated down too. Because what I'm saying is unhelpful. I'm masquerading my own ignorance (unless I was doing it on purpose, which doesn't make it better) as fact. i see you totally ignored my last post regarding his terrorist links not to mention his "preacher" back home that he was associated with at the Trinity United Church of Christ which teaches Black Liberation Theology, which was built from the core of Marxist Liberation Theology. you should also look up the organizations that he supported in Chicago including the Democratic Socialists of America(and received their full endorsement) and gave money to and read up on their views of society and the important of socialistic responsibilities. look up Frank Marshall Davis, obamas childhood and young adult mentor and a pronoun communist, and his other friends such as Bernie Sanders that he has closely associated with and looked up to for his decisions and you might be enlightened. A higher capital gains tax to punish the rich, even if it diminishes actual tax revenue, may be only the beginning of his radical socialist policies. read up on the Global Poverty Act designed to send hundreds of billions of dollars of U.S. foreign aid to the rest of the world, in order to meet U.N. demands.
  8. Quote:Original post by GameDev Doctor Quote:Original post by Scint Quote:Original post by Goober King The biggest problem is the Democratic side is already calling the McCain camp hypocritical. Having been pounding on the Obama has no Experience drum as hard, loud, and fast as possible. They have now said a woman with even less experience is fine and dandy. I was wondering how Fox News was going to spin the experience issue. Ends up, they are actually arguing that Palin has more experience than Obama. Whats amusing is that people brag that Palin has more executive experience than Obama (who, of course, has none), and therefore her experience is worth more. The flaw in this, of course, is that Palin also has more executive experience than McCain :) Her time has been spent as an executive. She's done budgets, personnel, and signed and vetoed legislation. Obama has done, oh, none of that. This is why his campaign's statement about her being the mayor of a small rube town was so silly. It allows Palin to say "Well, by all means, lets hear of your impressive credentials as a community organizer". The only executive experience he could claim was on that Challenge fiasco where his own final report says the money spent accomplished exactly zero improvement in the schools. And since the original grant proposal was written by a terrorist William Ayers who kept the lead active role in handing out all that money to political cronies instead of helping improve education (the stated goal in the proposal) Obama really wants to make the whole experience disappear from his resume. The point is Palin even before she joined the PTA, Ran for City Council, became mayor and governor was co owner of several businesses. She has more executive experience in her pinky finger then Obama does, and that's even if you include the prospective executive experience Obama had on that committee he served on in Chicago, but doesn't seem to want to talk about. You know the one where he served along with Weather Underground Terrorist William Ayers(mentioned above)? by the way isn't it nice when people lower your personal rating because they disagree with you? i see peoples ratings either skyrocket or plummet(more often than not) to the depths of the abyss when threads like this are created and people say something that is not on the same tote line of most of this boards demographic. i dont think ratings should be tallied on these kinds of threads(global warming, abortion, creationism, the iraq war etc etc) because people rate people up and down(most of the time) because they simply don't like what the other person said instead of actually being respectful and accepting what someone else says as just part of the discussion. just thought i would point this out -- not that rating means much on here anyway as i am sure some will point out.
  9. regardless of where you personally stand on issues at least you can know where she stands with no flip-flopping, especially regarding free-market capitalism(the reagan kind), abortion(pro-life, had her child at age 44 even though she knew he would have down syndrome), and pro-choice as far as education. We dont know what Obama stands for except that he for the most socialist policy that i have ever read...coming just shy to that of marxism. She is also a member of NRA and supports the use of guns as she is an avid hunter too.(that must scare the far-left). She is blue-collar and doesn't have to prove it because she has lived it and lives it. Of course all the "sophisticated" people in the northeast will try to strike her down because she isn't part of the "club"(shes a hunter, from a small town, has 5 kids, didnt go to brown, yale or harvard). America needs someone outside of CEO corporate washington to represent us. whatever else i have said in this post i think most of you will agree with this. When the state construed a budget reserve she took that money and put it into an Alaskan state savings account, instead of spending it just to spend it like wildfire and of course certain legislative bodies didn't like that. She also wants to drill USA oil, not get oil from places where people want to wipe us off the face of the earth. She has tried but our friendly government has said no way. Hmm wonder why?? she is "one of us". what i mean is she isn't from the CEO private fundy school with nothing but money and power on her mind. This is why she will bring votes in by normal americans and this is why the far left and the north-easterners will hate her guts. She has the highest approval rating of ANY Governer in the US. She was the key note speaker last year at the US Department of Energy summit. She is a reform candidate the cleaned up corruption in the Alaskan state government, actually selling the previous Governors two jets on EBAY...kinda funny...
  10. Quote:Original post by Mithrandir Quote:Original post by OpenGL_Guru Quote:Original post by LessBread Quote:Original post by trzy Looks like McCain's veep pick is Sarah Palin. Talk about your political choices... Picking a woman is about the only thing McCain could do to take back the media spotlight after Obama's speech last night. It's obvious that McCain is going after disgruntled Hillary supporters, so this pick keeps that meme living long after it's expiration date. And that she's from Alaska correlates well with McCain's "drill everywhere" energy policy. For all the Republican complaints about Obama's "cult of personality" (setting aside the fact that the Republicans have been operating a "cult of personality" and running on the "leader principle" for the entire 8 years of Bush), that entire article is all about Palin's personality. There's not a word in it describing the job duties of Governor of Alaska. There's no mention of the fact that the population of Alaska is only 700,000. That's less than the population of Fresno County here in California's heartland. Her wikipedia entry, Sarah Palin, suggests she's going to play the role of culture warrior - Anti-abortion, pro-death penalty, pro-creationism/anti-evolutionism, opposed to gay marriage. Is she qualified to be President? Is she ready to be President? Given McCain's age, his war injuries and his cancer, there's a real possibility that he could die in office. Good looks and culture war bona fides aren't enough to make the case that she is qualified or ready to be President. McCain should have gone with Romney. Sarah Palin has more experience than Obama. she has been governor and manager of a state for 2 years while Obama has done nothing but partly manage his own campaign while for 4 years been part of a senate without who has yet to chair a subcommittee meeting. who has the most experience? It seems to me that 4 is more than 2. Let me test that out for a second. Quote: Python 2.5.2 (r252:60911, May 29 2008, 09:50:36) [C] on sunos5 Type "help", "copyright", "credits", or "license" for more information. >>> 4 > 2 True >>> Yep. See for yourself. she has 2 years now of executive experience. that counts for more than 4 years of experience in Illinois where he has never been part of a committee panel or meeting and has had a tendency throughout his voting record of always marking "present" whether he was actually on the floor to vote or not. Obama has only been on the senate for 143 days. i would said Palin has more experience..and as i have already referred to above, years of any office doesnt mean anything. There are different ranks of office and the challenges and responsibilities each has. read up on Alaska, it used to be filled with all sorts of inner corruption and she cleaned the place up. she is also a proponent of drilling oil in the USA and getting out of dependence of foreign oil but the government has done their best to stop that from happening. Meanwhile obama doesnt want to drill in the US at all. even so, VP experience counts a lot less than Presidential experience in the long run.
  11. Quote:Original post by LessBread Quote:Original post by trzy Looks like McCain's veep pick is Sarah Palin. Talk about your political choices... Picking a woman is about the only thing McCain could do to take back the media spotlight after Obama's speech last night. It's obvious that McCain is going after disgruntled Hillary supporters, so this pick keeps that meme living long after it's expiration date. And that she's from Alaska correlates well with McCain's "drill everywhere" energy policy. For all the Republican complaints about Obama's "cult of personality" (setting aside the fact that the Republicans have been operating a "cult of personality" and running on the "leader principle" for the entire 8 years of Bush), that entire article is all about Palin's personality. There's not a word in it describing the job duties of Governor of Alaska. There's no mention of the fact that the population of Alaska is only 700,000. That's less than the population of Fresno County here in California's heartland. Her wikipedia entry, Sarah Palin, suggests she's going to play the role of culture warrior - Anti-abortion, pro-death penalty, pro-creationism/anti-evolutionism, opposed to gay marriage. Is she qualified to be President? Is she ready to be President? Given McCain's age, his war injuries and his cancer, there's a real possibility that he could die in office. Good looks and culture war bona fides aren't enough to make the case that she is qualified or ready to be President. McCain should have gone with Romney. Sarah Palin has more experience than Obama. she has been governor and manager of a state for 2 years while Obama has done nothing but partly manage his own campaign while for 4 years been part of a senate without who has yet to chair a subcommittee meeting. who has the most experience?
  12. hi all...i think i am having a problem understand or maybe just implementing rendering in different projections. below i have some code so you can see what problem i have. basically i am rendering some shapes using GL_LINE_LOOP which are being rendered with glOrtho in the projection class. after reading in the x,y points from a file i conclude what the left, right, top and bottom is so that i am able to draw the shapes. i am specifically giving you those numbers to hopefully give you a better understanding of my problem. in this case the left is -89.7, right is -89.3, bottom is 30.1 and top is 30.7. If i want to draw a rubberband however, i have to use glUnProject and thus the y-axis is upside down so i have to swap the bottom and top values in my glOrtho call in my projection class since y is in the opposite direction. If i don't swap them, as expected, the rubberband would be drawn on the opposite side of the window(depending on where my mouse is dragging). you can see the swap in the projection class itself in the setOrthoProj() function. to render my data i have to use a separate projection function otherwise my data would be drawn upside down. the problem i am having is that when i rubberband over my data i want to be able to "zoom in" whatever i rubberband over. how i want to zoom in of course is figuring out what are the coordinates of the rubberband and make that my new left, right, top, bottom values in my glOrtho call to correctly display the data. the problem is is that the rubberband and the data are using different projections now, that is the top and bottom values are reversed. As an example, let's say my rubberband coordinates are -89.668 for left, -89.504 for the right, 30.65 for the bottom and 30.34 for the top. if i used these numbers my new glOrtho would be: glOrtho(-89.668, -89.504, 30.65, 30.34); the bottom and top values are actually reversed from the data because i had to use gluUnProject as described above. how would i solve this? i am sure that i could make and manipulate the different projections but i was wondering if i wasn't making things hard on myself through a lack of understanding of how all these projections work. in other words is there a way to manipulate these projections without having to make separate functions for each one. it would be nice to have one setOrthoProj function. thanks SO much in advance for your help!! here is the code and an image at the bottom: //in main function void mouse(int button, int button_state, int x, int y) { if(button == GLUT_LEFT_BUTTON && button_state == GLUT_DOWN) { left_button_down = true; } else { left_button_down = false; is_dragging = false; } glutPostRedisplay(); } void myGlutMotion(int x, int y ) { GLdouble obj_x, obj_y, obj_z; GLdouble model_view[16]; glGetDoublev(GL_MODELVIEW_MATRIX, model_view); GLdouble projection[16]; glGetDoublev(GL_PROJECTION_MATRIX, projection); GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); gluUnProject(x, y, 0, model_view, projection, viewport, &obj_x, &obj_y, &obj_z); if(left_button_down) { if(!is_dragging) { mouse_start_x = obj_x; mouse_start_y = obj_y; is_dragging = true; } else { mouse_current_x = obj_x; mouse_current_y = obj_y; } mygrid->set_mouse_coords(mouse_start_x, mouse_start_y, mouse_current_x, mouse_current_y); } glutPostRedisplay(); } void resize(int w, int h) { width = w; height = h; if(h == 0) h = 1; float ratio = 1.0 * (GLfloat)w / (GLfloat)h; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-89.7, -89.3, 30.1, 30.7, 1, -1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } void render() { glLoadIdentity(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); proj->setOrthoProj(); glDisable(GL_LIGHTING); if(left_button_down) mygrid->draw_border(); //this is the rubberband else { mygrid->draw_border(); mygrid->draw_grid(1, 1); } glEnable(GL_LIGHTING); proj->resetPerspProj(); glPopMatrix(); glPushMatrix(); glColor3f(1, 0, 0); glDisable(GL_LIGHTING); proj->setOrthoProj2(); myshapes->renderShapes(); proj->resetPerspProj(); glEnable(GL_LIGHTING); glPopMatrix(); glutSwapBuffers(); } //projection class void projection::setOrthoProj() { GLint view[4]; glGetIntegerv(GL_VIEWPORT, view); // switch to projection mode glMatrixMode(GL_PROJECTION); glPushMatrix(); //save previous matrix which contains the settings for the perspective projection glLoadIdentity(); //reset matrix glOrtho(-89.7, -89.3, 30.7, 30.1, -1, 1); //set a 2D orthographic custom projection glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); } void projection::setOrthoProj2() { GLint view[4]; glGetIntegerv(GL_VIEWPORT, view); // switch to projection mode glMatrixMode(GL_PROJECTION); glPushMatrix(); //save previous matrix which contains the settings for the perspective projection glLoadIdentity(); //reset matrix glOrtho(-89.7, -89.3, 30.1, 30.7, -1, 1); //set a 2D orthographic custom projection glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); } //draw rubberband as part of my draw class. bool grid::is_border_valid() { if(mouse.current_x > mouse.start_x && mouse.current_y > mouse.start_y) return true; else return false; } void grid::set_mouse_coords(float s_x, float s_y, float curr_x, float curr_y) { mouse.start_x = s_x; mouse.start_y = s_y; mouse.current_x = curr_x; mouse.current_y = curr_y; } void grid::draw_border() { if(is_border_valid()) { glColor3f(1, 1, 0); glBegin(GL_LINE_LOOP); glVertex2f(mouse.start_x, mouse.current_y); glVertex2f(mouse.start_x, mouse.start_y); glVertex2f(mouse.current_x, mouse.start_y); glVertex2f(mouse.current_x, mouse.current_y); glEnd(); } } //rendering "shapes" void shapefile::renderShapes() { for(int i = 0; i < shapeCount; i++) { for(int j = 0; j < shapes[i].vertCount; j++) { glLineWidth(1.5); glBegin(GL_LINE_LOOP); glVertex2f(shapes[i].vertices[j].x, shapes[i].vertices[j].y); } glEnd(); } Image of rubberband on top of the data: or here is the direct link if the image doesn't show on the post. [Edited by - OpenGL_Guru on August 14, 2008 1:12:13 PM]
  13. Quote:Original post by Lord_Evil Taking a look at your code again, which projection matrix is used for gluUnproject? If it's the perspective, then your mouse coords can hardly be correct for rendering with ortho projection. can you explain in more detail? what i was saying was that while swapping my top and bottom in my projection class worked for the rubberband, i have data that corresponded to the original top and bottom settings of the glOrtho call. since i had swapped them that data was being rendered upside down...so i had mentioned making another function inside my projection class with the original top/bottom parameters to be able to draw them right side up.
  14. Quote:Original post by Lord_Evil Since you call setOrthoProj() each frame anyway, you should swap the values there. thanks for the help. so that means the data that needs to be drawn with the original view settings i need to set up a separate projection setting in my projection class with the original top and bottom parameters? i say this because otherwise everything will be drawn upside down. thanks again..
  15. Quote:Original post by Lord_Evil The window origin is at the top left corner so y is down. In OpenGL normally it's the other way round, so you should should swap the top and bottom values of your ortho projection. both my ortho calls or just in my resize()? i swapped around the glOrtho2D call in resize, just swapped 30.1 and 30.7 around and get nothing at all drawn then.....