Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Cobra

Timed demo's

This topic is 5933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay... I was going to make a timed demo to show all the effects e.t.c I could program (as most programs do), but I wasnt sure how to do the time-based scene transitions. I mean.... it starts with the first scene... with.. oh say.. a multi-textured bumpmapped cube with a lighting effect on it.. the cube''s spinning around and the camera moves around it... Then 15 seconds later it goes to the next scene... a radial blur effect on one of those pyramids of infinite size (made of triangles which are made of triangles which are made of triangles.... I forget the name of them). Can anyone throw some ideas at me that could help... thx.. making a time-based scene changing demo is something I''ve wanted to do for a while now, and there''s even more I can show now. Thanks in advance for any help. (even an example codebase I could learn from would be fine) ~Cobra~

Share this post


Link to post
Share on other sites
Advertisement
lol.... sorry.. after reading that I realised it sounded very n00b-ish.

All I was asking for ... was how to make the scene changes time-based. (the rest of that post was just examples e.t.c)

Thanks in advance for any help.

Share this post


Link to post
Share on other sites
That's simple. Here's one way...

have a variable to hold your time from start of the program. (float uptime=0.0f; ) Then every frame you increase this value for time that was spent on last frame ( uptime += timer.lastframetime; ). Then just have some function like this:

bool InTime( float time0, float time1 ) {
if ( time0<=uptime && time1>uptime ) return true else return false;
}

then in your code...


if (InTime( 0, 15 ) ) DrawScene0();
if (InTime( 15, 40 ) ) DrawScene1();
...


with this you can make some cool FX too.. (like matrix slow time FX) .. have another variable timeSpeed = 1.0f; and increase your uptime like : uptime += timer.lastframetime * timeSpeed; then you can change timeSpeed and the whole demo will speed up or slow down with it..

There are more worlds than the one that you hold in your hand...

Edited by - _DarkWIng_ on February 25, 2002 2:49:21 AM

Share this post


Link to post
Share on other sites
or how about keep a next_update variable, and then each frame check if GetTickCount(or equivalent) >= next_update. if it is, change to the next scene.

use function pointers for this!

Share this post


Link to post
Share on other sites
*slaps self in the head*

Get this.. I already had the frames per second counter running and everything, but for some reason I never even thought to link them.

Must've been one of those slow-brain days.

Now.. every second it increments my globan RunTime variable, and scene running is done based on time.

It was so easy... lol *slaps self again*

Ahh well... now to go do some cool effects. :D

Edited by - Cobra on February 25, 2002 10:46:28 AM

Share this post


Link to post
Share on other sites
quote:

one of those pyramids of infinite size (made of triangles which are made of triangles which are made of triangles.... I forget the name of them).



I''m not sure, but are they fractals? I''m not real clear on fractal geometry, but I think that the idea is everything can be broken down to smaller pieces that look like the original shape. Those "fractals" can then be drawn using iteration to make an infinite figure.

But I''m not for sure????????

Minion

Share this post


Link to post
Share on other sites
Nah... its called a _____ pyramid.

looks like a house of cards.

But then make that entire house of cards... one triangle (which it is.) and use loads of those to make a new triangle.. then take THAT triangle (its pretty huge by now) and use it with 2 others to make another triangle.. e.t.c e.t.c

hmmmm.. cant remember what they''re called.

Share this post


Link to post
Share on other sites
I think that''s called a Serpenski Triangle. It''s probably one of the easiest fractals to do and it looks pretty cool.

_________
"Maybe this world is another planet''''s hell." -- Aldous Huxley

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!