Timed demo's

Started by
7 comments, last by Cobra 22 years, 1 month ago
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~
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
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.
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
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
You should never let your fears become the boundaries of your dreams.
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!

*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
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
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
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.
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
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
_________"Maybe this world is another planet''s hell." -- Aldous Huxley
something like this?


thanks,
shurcool

This topic is closed to new replies.

Advertisement