Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Wed Nov 22, 2017 3:54 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Sun Oct 04, 2009 10:18 am 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
Voila je me demandais si s'était possible de faire une fonction raydium_ode_object_scale()?
mon but serait de crées une petite sphère qui grandi (cela éviterait que la sphère apparaisse d'un coup)

I was wondering if was possible creates a function raydium_ode_object_scale()?


Top
 Profile  
 
PostPosted: Mon Oct 05, 2009 8:11 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
glScalef(xfact,yfact,zfact) before object drawing will do the trick. As usual, call raydium_camera_replace() after drawing to restore the "default" matrix.

Raydium never provided wrappers for glTranslate/glScale/glRotate functions, since it's way too "application relative". If you want Raydium to deal with all this, use RayODE ... which lakes scaling feature ! :)


Top
 Profile  
 
PostPosted: Mon Oct 05, 2009 8:57 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
Merci mais l'objet est dessiné par raydium et pas par moi c'est une sphère crée avec raydium_ode_object_sphere_add de plus cela ne va pas changer la dimension dans la physique
alors si je comprend bien s'est pas possible pour le moment

Thank you but the object is drawn by Raydium and not by me, it creates a sphere with raydium_ode_object_sphere_add more it will not change the size in physics
So if I understood was not possible yet


Top
 Profile  
 
PostPosted: Mon Oct 05, 2009 11:01 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Sorry, I didn't understood you were already using RayODE ! It read your post too quickly, the function name was self-explaining. I'll have a look to this feature, it's probably very easy to add to the current API, if the scale only applies to rendering, and not to physic properties.

BTW, you probably mean raydium_ode_element_scale() (and not object), am I right ?


Top
 Profile  
 
PostPosted: Tue Oct 06, 2009 8:31 am 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
oui element ça sera plus pratique. une modification visuel et non physique serait déjà très bien
merci cela me donnera plus de possibilité d'arme pour mon jeux

yes element it will feature more practical. changes visual and non-physical is already very well
thank you that will give me more opportunity for weapon


Top
 Profile  
 
PostPosted: Wed Oct 07, 2009 7:11 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Added with rev 898. See raydium_ode_element_mesh_scale_*() functions.


Top
 Profile  
 
PostPosted: Wed Oct 07, 2009 7:52 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
Merci beaucoup je testerais ce week end

Many thank you I test this weekend


Top
 Profile  
 
PostPosted: Wed Oct 07, 2009 9:10 pm 
Offline

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

For testing purpose adding this in test6 line 744 (in if(vue==9 || vue==8) {)
Code:
    if (raydium_mouse_click==4 && id>0){
        float size;
        dVector3 l;
        size=raydium_ode_element[id].mesh_scale;
        raydium_ode_element_mesh_scale(id,size*0.9);
        size=raydium_ode_element[id].mesh_scale;
        dGeomBoxGetLengths(raydium_ode_element[id].geom,l);
        l[0]*=0.9;
        l[1]*=0.9;
        l[2]*=0.9;
        dGeomBoxSetLengths(raydium_ode_element[id].geom,l[0],l[1],l[2]);
    }
    if (raydium_mouse_click==5 && id>0){
        float size;
        dVector3 l;
        size=raydium_ode_element[id].mesh_scale;
        raydium_ode_element_mesh_scale(id,size*1.1);
        size=raydium_ode_element[id].mesh_scale;
        dGeomBoxGetLengths(raydium_ode_element[id].geom,l);
        l[0]*=1.1;
        l[1]*=1.1;
        l[2]*=1.1;
        dGeomBoxSetLengths(raydium_ode_element[id].geom,l[0],l[1],l[2]);
    }


Lauching a box space and using F8 vue, change object size with mouse wheel update size and physics.

Work quite well, what do you think about adding this as raydium_ode_element_scale ?

Have a nice day.
Ouille.


Top
 Profile  
 
PostPosted: Thu Oct 08, 2009 6:04 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
RayODE is not coded with such feature in mind : changing the geometry size probably implies a lot of side effects, like mass adjustment, attachments (particles emitters, for instance), joints, ... Only a few examples that just comes to my mind right now, the list is probably longer if we want to make something "stable".

To make it short, I see this as a quite tricky feature to code, with a minimal gain for the user. But I may be wrong :)


Top
 Profile  
 
PostPosted: Thu Oct 08, 2009 6:31 pm 
Offline

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

Ok, it was just a code snipset to show it is possible.

I think that we don't need this kind of function in raydium right now.

For joint, and particule, you'r right it will be more complicated !

Have a nice day.

Ouille


Top
 Profile  
 
PostPosted: Sat Oct 10, 2009 5:23 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
S'est superbe on demande si une fonction existe et quand elle existe pas 3 jours plus tard elle est là encore un grand merci.
Juste une petite chose en regardant le code de ouille je me dit qu'un raydium_ode_element_mesh_get_scale() serait plus propre. Mais personnellement je ne pense pas en avoir l'utilité

I asked if a function exists and when it is not 3 days later she was there. a big thank you.
Just a little thing, looking at the code of ouille I said a raydium_ode_element_mesh_get_scale () would be cleaner. But personally I do not have the utility


Top
 Profile  
 
PostPosted: Sat Oct 10, 2009 8:11 pm 
Offline

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

raydium_ode_element_mesh_get_scale () rise problem with physic during scale change.

I think it will stay as code snipset for who need it but, i don't think it need to be include in raydium because of this problem.

Have a nice day
Ouille


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 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:  
cron
Powered by phpBB® Forum Software © phpBB Group