Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Sun Oct 22, 2017 12:53 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Mon Jun 21, 2010 10:49 am 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Hi there,

I'm working on a project for realistic traffic simulation. Therefor we need a way to show which way a car wants to drive in a cross.
There are variables to decide easy if the indicator is on or not, and in which direction.

We have chosen Maniadrive for that project, because we had no need to code an engine or physics, so nobody knows how to add a blinker in easy way...
Has anybody done something like that yet? Or just a hint where to change some code... ;)

greetz matzze


Top
 Profile  
 
PostPosted: Tue Jun 22, 2010 12:03 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Perhaps trying to add a lens-flare ???

Or just change car texture with on with blink lighted.

I think that xfennec have a break light feature in his todo list since a long time.

Have a nice day.
Ouille


Top
 Profile  
 
PostPosted: Tue Jun 22, 2010 8:01 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
As ouille said, the best option is probably to use lens flares. I would try this way:
1 - launch test-lensflare.c and run the car demo (F5 key). it will download a few interesting files.
2 - create a new lens flare configuration file, based on lamp.lf, probably with fewer FX groups.
3 - attach this file on the car at indicators positions (see test-lensflare.c to see how, it's easy)
4 - make these flares blinking (with raydium_lensflare_switch() for instance) depending on time and your own variables

I think it would work quite well. In facts, current lens flare API is so excellent (to me) that my brake/head lights feature is simply obsolete, now :)


Top
 Profile  
 
PostPosted: Wed Jun 30, 2010 6:53 pm 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
hi there!

first of all thanks for the fast replys!
I tried the lensflares and they work well, but there are some problems left:

Description of situation:
I've created a box-system to decide who has to give way in crosses...
There are several boxes in one cross...
There are mutliple cars in a cross...
To change the position of a flare in easy way (because the car is moving ^^) I created two new "lamp-boxes" in front of each car and set it's position to the lensflare if necessary...

The effect:
1) It seems like the flares are invisible behind the boxes borders
2) If one flare dissapears behind an object all other do the same (although they're not actually covered)
3) the lamp-boxes are inertial, if a car starts moving, the boxes stay in their position for a while until they finally moving in front of the car

Can somebody explain this?

greets matzze


Top
 Profile  
 
PostPosted: Thu Jul 01, 2010 8:32 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
I must admit that I don't understand very well your system ... You talk about boxes, but what do you mean by boxes (models ? ode elements ?) Can you post a screenshot in debug mode (raydium_ode_draw_all(RAYDIUM_ODE_DRAW_DEBUG)) so we can see how you've build all this ?

All I can say is that :
- lens flares follows elements automatically if you attach them
- lens flares are only occluded by visible meshes, not by invisible elements


Top
 Profile  
 
PostPosted: Mon Jul 12, 2010 12:58 pm 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Hi there,

Xfennec wrote:
All I can say is that :
- lens flares follows elements automatically if you attach them


how can I do this? I tried to, but lensflares aren't ode objects so I can't use the raydium_..._attach-functions...

And here are three pics of the same cross in different views, with one car on the other side, which has left indicator on:

http://img535.imageshack.us/gal.php?g=bild1yz.png

greetz matzze


Top
 Profile  
 
PostPosted: Mon Jul 12, 2010 3:58 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
As said in one of my previous posts, you can have a look at test-lensflare.c, where you'll see functions like "raydium_ode_element_lensflare_offset_name_3f()".

I'm also curious about how you've created additional boxes for cross sections, since it seems you had a few issues with it (lens flare occlusion, low FPS, "lag", ...)


Top
 Profile  
 
PostPosted: Tue Jul 13, 2010 10:15 am 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Hmm now I see the problem.... My files were not up to date :?
I will try the way showed in the actual test-lensflare.c and report the result!

greets matzze


Top
 Profile  
 
PostPosted: Fri Jul 30, 2010 3:27 pm 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Hi xfennec,

I tried the new lensflare.c and it works well. :D

Quote:
I'm also curious about how you've created additional boxes for cross sections, since it seems you had a few issues with it (lens flare occlusion, low FPS, "lag", ...)


With the new way the occlusion effect is gone!
The low fps you've seen in the pics is just a changed debug information, not the fps.. :wink:

But I have still a question:
Can I make lenfslares invisible (or less visible) in far distances?
I tried to comment some code out in the lensflare.c (e.g. big glow in far distances) but you still can see them..
And far flares are shining more intensive than less distant flares... Is this effect reversible?

greets matzze


Top
 Profile  
 
PostPosted: Sun Aug 15, 2010 4:13 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Yep, it's true that currently, lensflares are not "distant-dependent". At first glance, it's quite easy to code, but we need some "data", since I currently don't know how distance affects size and opacity, but I'm pretty sure that's not linear.

I'll try to have a look at this soon, but, if you've any source or idea, it may help ... :)


Top
 Profile  
 
PostPosted: Mon Dec 13, 2010 2:59 pm 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Hi there - it's me again :wink:

Until now we use lensflares to solve this problem (in my opinion sufficient) but my boss said he wants to see the other way as ouille said:
Changing the car texture with on blink lighted.

How can I do this in (really) fast way?? Because it is concerning up to 10 (maybe 20) cars...

Hope you can help...

greets matzze


Top
 Profile  
 
PostPosted: Tue Dec 14, 2010 8:38 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

You can change element mesh on the fly using:
Code:
raydium_ode_element[elem].mesh=raydium_object_find_load((type==TYPE_CAR_BODY)?"clio_wheels.tri":"clio_sp_wheels.tri");

from mania drive.

Prepare 3 texture, normal, right blink and left blink. Then just alternate those mesh when flash light is on.

You can add a timer for this, wich automatically affect right texture.

Normaly this is no time consuming, except first time (texture load) but you can cache those texture during program startup.

Hav a nice day
Ouille.


Top
 Profile  
 
PostPosted: Tue Dec 14, 2010 2:47 pm 
Offline

Joined: Mon Jun 21, 2010 10:31 am
Posts: 12
Thanks alot! :)

greets matzze


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group