glRotate Question.

I have never insulted anyone for grammar errors or being from another country.

I have simply called people on their stupidity when I see it. (e.g. posting 3 exact same threads with the exact same message, within hours of each other.)

A lot of my “hostility” is something I think of more as “venting.” I have a bit of a dual personality in that I also post under another name, under which I help people quite often. Sometimes I need to vent a little, though. Some people can just be so frustrating.

You should go vent somewhere else. It’s not welcome here. Beginners are clueless by definition. If you don’t want to deal with clueless people, don’t read the beginner board.

Whatever.

Hello.

I am a stupid person. I need help with the following.

  1. How to use these message boards?
  2. What is difference between WinMain() and main()?
  3. What is better, C or C++?
  4. What is difference between the two?
  5. What is better, OpenGL or DirectX?
  6. I get problems with undefined WINGDIAPI in gl.h. What gives?
  7. Can someone help me fix my simple syntax errors?
  8. I get linker errors that say undefined reference to all the OpenGL functions I use. I do not understand. I included gl.h.
  9. I don’t know anything at all about 3d math, but I want to program OpenGL. How to do this w/o learning math?
  10. I just started programming and I want to do OpenGL. Where to start?

Latrans/Procyon, why you gotta h8 on me so much?

Seriously though, I have a tough problem. Gonna need all yer guys help for this.

void main (void)
{
   int arraySize; cin >> arraySize;
   int array[arraySize];
}

This program gives me strange compiler errors! I’ve been programming for a full month, so this isn’t a regular problem or else I would have solved it. HELP!

If everyone read the redbook we’d have no beginners.

Here you have links to OpenGL books online.

You find “The Official Reference Document for OpenGL, Release 1” (The Blue Book) at http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_RM/.

And you find “OpenGL Programming Guide” (The Red Book) at http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/.

Happy Hacking.
Dont forget to eat and sleep.
Cowboy

Stupid Person, I cant tell if your being fesecious or not, but if you are legit, the answer to your question is that what you are doing is illegal. You have to use the new operator to declare a (on the fly) array like that.

void main()
{
int *ArrayWanted; //Used to create the new array.

int ArraySize; //Size of array needed

cin >> ArraySize; //Read in the size

ArrayWanted = new int[ArraySize]; //Create the new array

//use the new array here

delete []ArrayWanted; // Return the memory to the heap.
}

StupidPerson and dabeav, seams to me that you can initialize your array like you did, otherwise you should try another compiler. At least this works without any problem with GCC.
in pure C, however, you can’t initialize an array with variable size, but GCC compile it fine anyway.

What was the point, agin ?? :slight_smile:

@rixed: A compiler shouldn’t compile code like that, cause it’s wrong. The array is dynamic (cause you don’t know the size during compile time) and therefore memory has to be allocated from the heap.

it certainly is. When you ask GCC (or G++) to be pedantic, it complains about such declarations.
But in C++, as you can define variables anywhere in the code, you can suppose that memory on the heap or stack for those variables are actually allocated when the variables are declared, so that there are no technical reasons why variable sized arrays should not work.
Thats why most compiler should be able to compile it.

The reason why C++ doesn’t allow it is perhaps for the compiler should choose to allocate local variables the C way, that is allocating the whole memory needed for local variables in the stack so that there is only one allocation/desalocation when you enter/leave the block. The syntax of C++ suggests a more general behavior, even if its not in the specs.

Deiussum, (if you’re still there… the conversation has degenerated a bit…) you mentioned thinking about order of matrix operations in reverse… which is an interesting way to think about it (and maybe the correct way, if there is one) but it started playing with my head nonetheless because I’d been thinking about it differently. For a long time.

Tell me if this is wrong and/or what you think of it:
I’ve been thinking of matrix operations in order, but as acting on the coordinate system.

so that
glRotate(180, 0, 1, 0);
glTranslate(5, 0, 0);

In my head rotates the whole coordinate system 180 degrees around Y, so the translate still put it 5 units down +X, except that +X happens to now be in the direction -X used to.

So it looks the same as thinking in reverse, that you translate +5 down X, then rotate 180 degrees around the World’s Y axis.

I’d certainly like to know if I’m wrong in my thinking about this, even if it works. Or maybe they’re the same exact thing. It’s early and my brain’s not completely functioning yet.

rhmazza,

Yes, your way of thinking about it is also correct. It is just looking at it from a different perspective. For myself, I find thinking about the main coordinate system as being fixed a bit more intuitive, though it means I have to think of the transformations in reverse. When I start thinking of the coordinate system as being moved, my head starts to spin.

Thanks, that clears things up a bit. It’s funny that I’d never heard or thought of thinking about it in reverse. I agree, it’s a more intuitive way of thinking about it! I’m sure it’ll help me out a bit!