Raydium 3D Game Engine
http://memak.raydium.org/

Crokinole Game, drawing a line
http://memak.raydium.org/viewtopic.php?f=8&t=740
Page 1 of 1

Author:  Tabasco [ Tue Jan 08, 2008 5:31 pm ]
Post subject:  Crokinole Game, drawing a line

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?

Author:  vicentecarro [ Tue Jan 08, 2008 10:57 pm ]
Post subject: 

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.

Author:  Tabasco [ Tue Jan 08, 2008 11:05 pm ]
Post subject: 

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.

Author:  vicentecarro [ Thu Jan 10, 2008 11:41 pm ]
Post subject: 

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:

Author:  Tabasco [ Fri Jan 11, 2008 3:47 am ]
Post subject: 

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.

Author:  ouille [ Fri Jan 11, 2008 5:51 pm ]
Post subject: 

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.

Author:  Tabasco [ Fri Jan 11, 2008 6:11 pm ]
Post subject: 

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.

Author:  ouille [ Fri Jan 11, 2008 7:21 pm ]
Post subject: 

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

Author:  Xfennec [ Sun Jan 20, 2008 8:50 pm ]
Post subject: 

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).

Author:  ouille [ Sun Jan 20, 2008 9:16 pm ]
Post subject: 

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

Author:  Tabasco [ Mon Jan 21, 2008 2:12 pm ]
Post subject: 

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/