Advertisement

rotations... (center of rotation)

Started by August 18, 2001 01:04 PM
14 comments, last by dirtypope 23 years, 5 months ago
Just for fun, try flipping the two glRotate*()s around. *shrugs*

Dragonus
Thought of the Moment
"Everything, no matter how unlikely, has a very small yet finite chance of happening." ~Heisenburg''s Uncertainty Principle
That still gives me hope that, one day, I''ll be teleported to some remote desert isle surrounded by women who think I''m a god.
quote:
Original post by Dragonus
Just for fun, try flipping the two glRotate*()s around. *shrugs*


Verry oddly, that was the problem, lol thanks =)

Theres no such thing as stupid people... only people with under clocked brains. -dirty
Advertisement
sorry about this late reply, (been building a new comp desk(its HUGE)) but, the horizontal rotations work perfect, and the vertical work near perfect, except when i look so far up or down, i need to like pull in the model in order for it to look correct, i was wondering if there is a simple way to do this....

also theres 2 more things im interested in,

a) Bitmap Screen Shots, is there a tut out there to save the screen to a bmp so that i can take screens in fullscreen mode?

b) i want to make it able to toggle keys, i was wondering if theres a nice tut on creating like a keys.cfg file... i have an idea on how to do it sorta, but i think it wont work heh,

heres my idea,
1) have a char, lets call it "jump"

2) read "jump = SPACE;" out of keys.cfg

3) in the keys section of code have [DIK_jump] for my jump function, therefore jump will be space bar.

4) have an options menu to select new params for the keys...
so that if some one changes jump from SPACE to like X, X will now be to jump, and it will write in keys.cfg jump = X so that the key will be saved and loaded next time they load the app...

thats my idea, but i dont think it will work...

thx in advance,
dirtypope
Theres no such thing as stupid people... only people with under clocked brains. -dirty
As far as the rotations/translation up there, try doing what I told you to do, only put the 4 rotations/translations backwards order. I might have accidentally goofed when I told you what to do... ^_~

quote:
b) i want to make it able to toggle keys, i was wondering if theres a nice tut on creating like a keys.cfg file... i have an idea on how to do it sorta, but i think it wont work heh,


Well, let''s think about this now...

Declare an character: unsigned char jumpButton = 0;

Read in the keys.cfg file and determine the key to assign it to:

FILE* fin = fopen("keys.cfg", "r");
char buffer[100];
fscanf(fin, " %s", buffer);
.
.
.
if(!_stricmp(buffer, "jump")) jumpButton = getKey(fin, buffer);
.
.
.

char getKey(FILE* fin, char* buffer)
{
fscanf(fin, " = %s", buffer);
if(!_stricmp("SPACE")) return '' '';
else if(!_stricmp("ESCAPE")) return (char)27;
.
.
.
else return buffer[0];
}


Then all you do is test for myKeyboardArray[jumpButton] throughout the entire ordeal. Of course, when you reset it to another character in the options menu, you''ll be overwriting it to another character, but I think it''ll work.

~ Dragonus
heres is what i have....

glTranslatef(xpos, ypos, zpos);
glRotatef(sceneroty,0,-1,0);
glRotatef(lookupdown,-1,0,0);
glPushMatrix();
glTranslatef(0.06f, 0, -0.2f);
pModel->draw();
glPopMatrix();

that works great for looking side to side, but, when i look up or down, the model rotates how i want, but doesnt stay where i want, i tried translating it back some after its rotated, but that makes it rotate arround 0.0.0 and not arround my current xyz, so im boggled for now....
Theres no such thing as stupid people... only people with under clocked brains. -dirty
i had a quick read of the posts + it seems youre getting into trouble cause youre using eular angles read this

http://web2.airmail.net/sjbaker1/omniv.html (eulars are evil)

This topic is closed to new replies.

Advertisement