View Full Version : anyone have resources on input for interactive opengl program?
09-14-2000, 02:41 PM
Some of the people in my physics class today mentioned that it would be cool to make a shooting computer game where you were moving at the speed of light.
This would have drastic and unituitive effects on how you had to aim because of relativity.
I want the animation to be fast(not quite the speed of light, but fast http://www.opengl.org/discussion_boards/ubb/biggrin.gif) i was wodering what's the best method for getting input from the user in that case? can anyone point me in the right direction? thanks.
09-14-2000, 02:58 PM
I would do it the normal way
for example if you used glut and the keyboard you could register a keyboard function with
and then in yourfunc(int x, int y, char c)
catch the shooting button (say s)
however, I would like to warn, that moving at the speed of light (or a speed comperable) is going to take a massive amount of world space in comparison to the character (that is lets say you are in space you will have to define an area very large so you can actually travel the speed of light (even if you dont accelerate) because the motion will be like this
you are at point x... you move (at a very fast speed)
where will your next position be
x+c*direction where direction is the way you moved (unit vector) and c is your speed in this case the speed of light. As far as simulating the inertia (that is the bullet you shoot will have inertia and move along with you consult your favorite physics book
09-14-2000, 03:29 PM
Yeah, i was thinking maybe it could be simple like not necessarily a human character but maybe just some fancy shape like a geodesic dome that is the target.
I see what your saying though. would i have less volume to deal with if i shrunk the angle of the field of view in the perspective and just draw everything real small? Or is that just a 'round about way of getting the same bad overhead effects as before? Thanks alot for your post. http://www.opengl.org/discussion_boards/ubb/smile.gif
09-14-2000, 04:45 PM
After consideration (a large world space is not that big of deal.....
Its all about scale
Lets say the tagets and you are spheres
Lets say you want to be a sphere of raduis
10 meters (approx 30 ft for us americans)
Anyway you can draw yourself really as big or as small as you want, but everything else has to be the same scale .... that is if you draw 10 meters as a unit 1 then a unit 1 in world space=10 meters and you must move c/10 units(c=velocity of light) to move at the speed of light in your world,
My original problem was this: if you were in a field or a city or whatever you are going to have to have a lot of terrain to move that fast) whether its big or small is really irrelevant because you must maintain scale or things wont look right.
Now why do I think it is not such a problem?
How many times did Cptn Kirk go the speed of light (excluding transporter beams) in a city or in a field (I think 0)....
So if you had a world that was basically
void (except say stars and planets then no problemo, you will not have a ton of geometry to render, nor will you have big overhead taking care of it all) you will of course have to have a humongous viewing volume (humans do, after all we can see millions of light years away), but you can clip the stuff that you can't see out (which probably wont be much, except the stuff behind you)
Some more tips, if I were to build this program (where a massive view volume is necessary) I would probably use primarily spheres for my objects (stars/planets) and would use dramatic lod processes to keep the complexity down (very easy to do)
I think that many space games dont render such a big volume, so maybe this is all just rhetoric (and stupid) however I don't think that many games allow you to actually interact with your spaceship (or sphere) or whatever when you are actually travelling that fast....
Regardless it would be interesting to see and maybe I will implement something similar and share it with you.... (I am kinda busy so it may be awhile, (probably)), but anyway those are my opinions and with these an 25 cents you can buy your self a cup of coffee anywhere.
Good luck (I hope you try it) Ribbit
Live long and prosper
09-14-2000, 06:49 PM
Yeah i was thinking about having the only scenery be, well, hehe, i don't know what its called. ever played counter-strike and after you die and you're a ghost you leave the level (walking through the walls, and leaving the playing field boudaries). you can observe in ghost mode how they created the "sky" and distant scenery.
It's like your inside of a globe and a giant bitmap is wrapped around the inside of the globe, thats all it is. I just wanted some stars and stuff on a dark dark blue bitmap.
The main point is to see how freaky it is to aim a gun when you're experiencing time dialation and distances shrinking and all that weird stuff. so basically the graphics can suck. anyway, i'll cry if i see my geForce render anything slowly, so i'm gonna try to stay away from quake 3 at the speed of light http://www.opengl.org/discussion_boards/ubb/smile.gif. thanks for the help.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.