Vector Locust - TIGsource "cockpit compo" entry

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hey jph, you shouldn't pull back a drunken post there was nothing wrong with it. We are all human here after all :)

Kattle, look forward to seeing your Locust-video. Post the link here whoever of you uploads to youtube and I'll add it to the ZGE wiki "Screenshots and videos" section.
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

It states that "this video is still under elaboration, quality might get better when elaboration completes". I hope so, since the original was 800x500 pixel, for a total of 250 MB that took me 2 hours to upload :P
http://www.youtube.com/watch?v=s5umfvWA4Yc

At JPH: I laughted pretty hard when I saw the word "redacted" :)

If I were you, I would just post the youtube links back... that music was just too nice :D

EDIT: I don't know what the hell happened... but I messed up some stuff so ended encoding and uploading the "wrong" video (the uncutted one!)
...ARGH...
Well if you want I'm just gonna start the recording again tomorrow... and get a better one... This time no confusion :P
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Congrats JPH!!!! You got 4th in the compo!!! :D
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

HA! thats not bad eh,. no medal for me :(
Well, at least some ppl got to see what ZGE can do even in my clumsy hacker hands,. :) not a few ppl have mentioned to me that they have looked into ZGE after having played it! so, I think it worked in that,. one of my goals for doing it, and I learned a bunch, that is good also,. compos can be great fun,. when they are done for the right reasons. I do like the TIGsource ones,. and LD is fun too, but in a much more time pressure kind of way,. . not so happy with my results there, but I will try the next LD too.
iterationGAMES.com
User avatar
zakkwylde
Posts: 29
Joined: Sun Feb 24, 2008 1:38 am
Location: France

help guys!

Post by zakkwylde »

hi guys,
heres my attempt at making a flight sim. I tried to implement acceleration based on engine RPM and whatnot. Here are the keys:
W/S - RPM+/-
Z/X - Rudder
Left/Right Cursor Keys - Roll Left/Right
Mouse-Look

I like the fact that its got il2 type of cockpit viewing, and not very difficult to centre back to front view. The Idle RPM is about 2000. Max is 4000. But here are my probs:

1) I want to make this a flight sim, hence i want it to Roll fully 360. And whn it rolls 90degr, its the max turn rate. rolling >90degr will reduce the turn rate. Can anyone help on this?

2) I also want to include pitch up/down. But when i add in currentmodel.rotation.x, it pitches up alrite but when i turn around, pitch up becms pitch dwn. I could use a formula for this if anyone knows?

3)Whats with the forum these days?villeK, hows it going for the next ZGE version?
Attachments
Cockpit.rar
(39.54 KiB) Downloaded 665 times
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:?

Since ZGE uses Euler Angles for all it's rotations you're going to run into Gimbal Lock. This makes doing camera systems that use full yaw, pitch and roll incredibly difficult. The solution are Quaternions ( which is what most engines use for rotations ). I started on a Quaternions library for ZGE some time ago, but never got my head around some of the more complex functions that go with it.

Unless you're comfortable with non-commutative math, I'd forget about doing games without a consistent up/down axis in ZGE for now.

Sorry,
K
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

I once banged my head a little around, and maybe I actually can came up with some solution. However, 3D geometry is far more difficult that one could imagine. I can try to sort something out, by using vectors and rotations in a "smart" way. I will let you know what I came up with.
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Indeed this is an interesting question,. I had tried for my intial compo idea to do a 6 degrees of freedom game,. however I too got boged down in math I was not comfortable with,. this would make a good black box candidate,. provideing a mathod for users to work with 6dof without having to understand the math under the hood,. . I did find a great example back when i was still working in GameMaker,. I think it was TAB's flight engine. It was small and worked and solved gimblelock,. I do belive it was based on some implementation of quaternions,. however I was able to just hack around that code and acheive basic game,. unfortunaly i can not locate that file,. I did however find what looks like a nice tutorial with source that seems to be based off that,. unfortunaly with a lot of added complexities,. I don't have time to look through it all, (new game on the go!) but here;

http://gmc.yoyogames.com/index.php?showtopic=356774

have a look it may be transferable to ZGE.., if anyone gets if going please share!
iterationGAMES.com
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

That tutorial is based on the same idea I had ^^
I could try that out. I still had not fully understood quaternions (must google for something that makes it clear how they works, in the sense of how the end user uses them) so I don't know if quaternions rotations are worth implementing or not :/
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Ok, I'm almost there. I discovered what was the so-damn-hard part of the problem. It lies in the way ZGE handles rotations (a quite non-standard way ^^)
A lot of stuff would probably be easier if the end user was given direct access to the function glRotatef(), since it allows rotation around an arbitrary axis.We might want to add it to the RenderTransformGroup in a form of a quad-variable entry.
I will post something tomorrow or later today if you are still interested in it.
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hmm,

Non-standard way? I had moments when I suspected that as well .. even messaged Ville about it. But in the end it always turned out I was scr*wing up instead of ZGE :) Keep in mind that OpenGL uses a righ-handed coordinate system, while Direct3D is left-handed.

Game Maker let's you apply rotations sequentially ( you can do this in ZGE as well, but not on the camera ), so you never have to run into Gimbal Lock using Eulers as you need to set the render matrix "manually" every frame for each individual 3d model anyway.

K
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

As far as I can remember and I can read from Wikipedia, the standard is rotate around Z axis then around X (also called N) then around Z... where X,Y,Z are the axes of the rotating frame (the model's one, just to be clear). Instead ZGE does a X then Y then Z rotation. I agree this is quite the simpler way of doing it but actually those should just not be called euler angles.

Making a cockpit control is amazing simple given the local rotations. PROVIDED that you are able to "chain" a lot of "very little" rotations. Actually I don't kow how to do it properly by using the RenderTransform component. ^^
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
zakkwylde
Posts: 29
Joined: Sun Feb 24, 2008 1:38 am
Location: France

Post by zakkwylde »

guys,
i have been checking on the quarterions and the GM flight sim tutorials. I think the latter is alot more readable but how we convert GM codes to ZGE i have no idea. Hopefully one of us will get an answer. For now i think the cockpit demo i made would serve as some kind of hovercraft sim. Or better yet, with a bit more tweaking, i could make a helo sim also, incorporate a down and up thrust. It will have to look damn good to make up for the lack of full motion control....!
Post Reply