Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Nov 01, 2024 12:16 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Tue Jan 08, 2008 5:31 pm 
Offline

Joined: Tue Jan 08, 2008 3:10 pm
Posts: 10
I'm working on a simple crokinole game using Raydium.
(http://en.wikipedia.org/wiki/Crokinole)

What I have so far is a game board, a preliminary texture, and game pieces.
http://img228.imageshack.us/my.php?image=cctestfk6.jpg

Right now the heading of the active piece is shown using osd_printf, but I'd like to draw a line coming from the center of the active piece that changes to show the heading. On test6.c I see a red line coming from the gun on the buggy that isn't present in the model, but I can't seem to find how it is getting there.

What would be the best way to render such a thing using Raydium?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 08, 2008 10:57 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I think you are talking about a "ray".

42.76 signed char raydium_ode_element_ray_attach(int element, dReal length, dReal dirx, dReal diry, dReal dirz):

By the way, i have seen the capture. And i think you can change that lowres texture for a real mesh. The board doesn't look too complex and it will improve higlhy its quality.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 08, 2008 11:05 pm 
Offline

Joined: Tue Jan 08, 2008 3:10 pm
Posts: 10
I attached a ray to the piece but couldn't see it. Just to make sure, I assigned a ray collision function and confirmed that it was attached correctly and responded to hits when appropriate.
What I'm looking for is a strictly visual effect.

On a somewhat unrelated note, I spent some time implementing the ode cylinder since it's the shape that would be ideal for the game pieces.
So far it's working, I just don't have the debug_draw_all mesh showing up and I skipped the recording functions.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 10, 2008 11:41 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Are you using raydium_ode_draw_all(RAYDIUM_ODE_DRAW_RAY) ? I think this has to be called after the regular raydium_ode_draw_all calls, so you can draw the lines of the ray over the mesh drawed.

About the cilynder code, can you paste here a diff of the implied files?
Maybe someone else can finish the work, it would be a great improvement into Raydium. :roll:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 3:47 am 
Offline

Joined: Tue Jan 08, 2008 3:10 pm
Posts: 10
I'll try that, thanks!

As for the cylinder, I planned to post my changes once fully implemented. The problem is, the cylinder in ODE seems to be bugged. Even with no slip it never fully stops. It just sits there and wiggles very subtly, or moves very slowly along the last force vector.
I'll do a little cleanup and post what I have.

Edit: That did the trick, now to get it rotating appropriately.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 5:51 pm 
Offline

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

Cylinder are not fully implemented in ode.
Cylinder / Cylinder collision are not implemented (not complete).

And cylinder to plane raise a stability problem.

Perhaps you can try to damp results force to stop cylinder rolling on his face.

Have a nice day.
Ouille.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 6:11 pm 
Offline

Joined: Tue Jan 08, 2008 3:10 pm
Posts: 10
I've noticed that in their demos they use dMassSetSphere instead of the cylinder mass function. Fixing that allows the object to finally come to rest, but only with low slip.
I might try using a small, thin box for the sliding surface and then use a fixed hinge to attach a cylinder to the top so that I still have an appropriate surface to respond to lateral collisions.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 7:21 pm 
Offline

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

Perhaps using a composite object a cube for plane contact and cylinder for lateral collision.

This not yet supported by raydium, but it's possible.

Perhapse you can filter contact point in the raydium collide callback to stabilyze the cylinder.

Have a nice day
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 8:50 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2593
Location: gnniiiii (Scrat)
Hi,

The idea of composite objects is good. You perhaps already know this, but you can use a "fixed joint", have a look to raydium_ode_joint_attach_fixed(), for example. You can also, reset rotation of the sphere each timestep on X and Y (we use this for the FPS player in test6).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 20, 2008 9:16 pm 
Offline

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

Be carreful about fixed joint they cause lot's of instability.
After several tests it appear that ode don't like fixed joint.

A very small modification in mass, anchor point can make ode explode.

So if you experinece strange behaviour with fixed joint remember this.


Have a nice day ouille


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 21, 2008 2:12 pm 
Offline

Joined: Tue Jan 08, 2008 3:10 pm
Posts: 10
I tried a simple composite of cylinder and box using the fixed hinge and it behaved the same as the cylinder alone. If I remove the cylinder, it slides like it is supposed to and comes to rest appropriately, but as soon as the two are linked, if there is any slip it will not stay still.
I have a few more things to try and I'll update as I get time.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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:  
Powered by phpBB® Forum Software © phpBB Group