• Content count

  • Joined

  • Last visited

Community Reputation

139 Neutral

About bull_dog

  • Rank
  1. Seamless Noise

    Another question about x1, x2, y1, y2. It's one thing to know possible values for these, but another to know their function! Can you shed some light on what exactly these parameters do?
  2. OpenGL Plane class

    Its not the culling, nor is it lighting. I know because I switch it to wireframe, and still nothing comes up. I tried anyway, just in case wireframe wasn't working, but still nothing came up. It must be something else, somewhere in my program. You might be right about the name. :)
  3. Why do people call it maths?

    Quote:Original post by juanpaco hahahaa. Yeah... I've never seen it either outside of television and movies. :) As for "centre," that's interesting. I don't see the "ur" sound out of having the r before the e. I wonder how that word actually evolved. I'm a fan of s instead of z in thingz like initialize/-se. But that's mostly because I spent two years in France and it reminds me of speaking French. But, as they say, "l'usage dicte la règle," or usage decides the rule. Neither way is better as long as we can still communicate, right? So, are there some differences between the English spoken in America and the English spoken in other English speaking areas that are less superficial? Like, can anyone think of any real grammar differences or something? I think centre actually comes from French as does theatre. I think they have a lot of words that end like that. It is certainly a Latin based word, so I would assume the other Latin derived languages would contain similar constructs. Most of the differences in English I know of are based in common social language, basically slang! The dialects vary around the UK quite a lot (If you ever go to the north east you may here people saying "waay eye!" Thats certainly not in the dictionary, but is widely understood as greeting). Also in Celtic English (Scottish and Irish), the word "wee" would be used in the place of "small". In South Africa the English is slightly different again, they will say "a chocolate" where I would "a chocolate bar". In East African countries they will say "is it?", again as a greeting kinda like "how's it going?". These are all still fairly superficial as they are based around informal social interaction. For the official formal English, most peoples will stick to British English. Quote:But, as they say, "l'usage dicte la règle," or usage decides the rule. Neither way is better as long as we can still communicate, right? Absolutely right. :)
  4. OpenGL Plane class

    Quote:Original post by nts You are creating your index buffer using unsigned shortsindexBuffer = new unsigned short[(((divisionsX+1)*2)+2)*(divisionsY+1)];but using it as unsigned ints glDrawElements(GL_TRIANGLE_STRIP, rowSize, GL_UNSIGNED_INT, &indexBuffer[i*rowSize]);replace GL_UNSIGNED_INT with GL_UNSIGNED_SHORT. LOL! Cheers dude. Its always the obvious ones that get me! Even if I had spotted that, I wouldn't have thought it would matter. I was under the impression that when you type 'int' it defaults to 'short'. Oh well, thanks, it fixed the error. There is nothing showing in the window of my application however, but I guess thats another problem! :)
  5. Why do people call it maths?

    Quote: Whatever! You guys go to the centre of the shoppe! That drives me nuts. :) We save two letters on the latter, and we spell the former as it is actually said. Let's see if we can fan these flames! :) Firstly, "centre", is still spelled as is it is pronounced. Its not as obvious as "center", but this comes back to the lego english thing from my previous post. Secondly, I have never seen the word shoppe anywhere unless I was in one of those educational mock up villages from back in the times of Chaucer. Quote: You don't take letters from the end of a word when abbreviating. Except if you are abbreviating its plural form. Mathematics doesn't have a plural. So you would usually chop out the middle of the word. E.g. Doctor would become Dr, Mistress would become Mrs. That way the word keeps the same sound and the abbreviation can more easily substitute for the full word in a block of text.
  6. Why do people call it maths?

    Quote:Original post by Grain You don't say "sciences" when talking about science in general. Only when discussing different disciplines of science: physics, chemistry, biology. You don't say "languages" when talking about the concept of language in general. Only when talking about different languages: English, Japanese, German. Math sounds better when talking about it in general. Its a singular entity and it sounds wrong to pluralize it. Its fine to use maths when talking about multiple disciplines, like trigonometry, calculus and algebra. The American way is more correct and consistent with the language. Just because you invented the language doesn't mean you guys speak it better. We've refined and improved it. :p It is not more consistent. American English always sounds very much like "lego english" its easier to say for kids. But adults seem continue to use it also. We say languages and sciences simply because they are different words and hence different rules apply. Science is a field of which there are many sciences. Language is term that can be in reference to many languages. Maths is a system of working with numbers. There are different ways of working with numbers which are all still types of maths. Math would be an abbreviation of mathematic, which isn't even a word. The word is mathematics, so the abbreviation would clearly be maths. That would more consistent wouldn't it? :) Quote:Original post by SirKnight There is no right or wrong way. One variation of a language is just as "correct" as any other. Languages change from region to region and evolve though time; which is a good thing. QFT
  7. Hey everyone, I have tried to write a plane class that when passed parameters will create a flat 2D plane using opengl vertex buffers. It all looks ok to me, but I get a run time error and I am not sure what is wrong. I have tried stepping through the code, and the parameters seem to be passed in correctly, and the class seems to be initialised ok but, when it gets to the drawing part I get an error. See below for error code. I am pasting the main bits of code here, and attaching a picture that helps to explain how it works. bool Plane::Create(float sX, float sY, int dX, int dY, char *tex) { texFile = tex; sizeX = sX; sizeY = sY; divisionsX = dX; divisionsY = dY; int array_size = (divisionsX + 2) * (divisionsY + 2); vertexBuffer = new Vector3f[array_size]; normalBuffer = new Vector3f[array_size]; texCoordBuffer = new Vector2f[array_size]; indexBuffer = new unsigned short[(((divisionsX+1)*2)+2)*(divisionsY+1)]; for (int i = 0; i < array_size; i++) { normalBuffer[i].x = 0.0f; normalBuffer[i].y = 1.0f; normalBuffer[i].z = 0.0f; } //generate vertex and tex co-ords. float vertex_incX = sizeX / (divisionsX + 1); float vertex_incY = sizeY / (divisionsY + 1); int vPos = 0; for (int i = 0; i <= divisionsY + 1; i++) { for (int j = 0; j <= divisionsX + 1; j++) { vertexBuffer[vPos].x = vertex_incX * j; vertexBuffer[vPos].y = 0.0f; vertexBuffer[vPos].z = vertex_incY * i; texCoordBuffer[vPos].x = (float)(1 / (divisionsX + 1)) * j; texCoordBuffer[vPos].y = (float)(1 / (divisionsY + 1)) * i; vPos++; } } //generate the index array. int iPos = 0; for (int j = 0; j <= divisionsY; j++) { int start1 = j * (divisionsX + 2); int start2 = (j + 1) * (divisionsX + 2); for (int i = 0; i <= divisionsX+1; i++) { indexBuffer[iPos] = start1; iPos++; indexBuffer[iPos] = start2; iPos++; start1++; start2++; } } texID = TextureManager::getInstance()->LoadTexture(texFile); return true; } void Plane::Draw() const { glEnable(GL_TEXTURE_2D); TextureManager::getInstance()->ApplyTexture(texID); glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, &vertexBuffer[0]); glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(GL_FLOAT, 0, &normalBuffer[0]); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(2, GL_FLOAT, 0, &texCoordBuffer[0]); int rowSize = ((divisionsX+1)*2)+2; for (int i = 0; i< divisionsY + 1; i++) { glDrawElements(GL_TRIANGLE_STRIP, rowSize, GL_UNSIGNED_INT, &indexBuffer[i*rowSize]); } glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); } The problem is apparently with this line: glDrawElements(GL_TRIANGLE_STRIP, rowSize, GL_UNSIGNED_INT, &indexBuffer[i*rowSize]); It gives the error: Unhandled exception at 0x691ca718 in Zargons2.exe: 0xC0000005: Access violation reading location 0x018360bc. Any ideas? Oh I should also mention that Vector3f is a class that holds three floats and a bunch of functions for vector mathematics.