Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [dark dynamix] DBPro object get offset but its DarkDynamix counterpart shape not!

Author
Message
Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 30th Jan 2013 00:01
Hi, I add the rotable tail rudder on my airplane tail.
Here the procedure:

1) I make a DBPro box object as my rotable rudder

2) I set the position of this rudder object

3) You know the rudder rotation is like a door rotation. When I made the object the pivot is x0,y0,z0. So I changed this pivot using :
Offset Limb 9026,0,0,0,-0.4
Fix Object Pivot 9026

4) I give the DarkDynamix Physic to this rudder:
DYN MAKE BOX 9026, 0.07

5) I join this rudder to the airplane :
makeJointFixed(jointNumb,airplane_obj,rudder_obj)

6) Now I add the code to obtain the rudder rotation:
DYN SHAPE SET LOC ROT 9026,0, 0,gradi_rotat_timone#,0

rotate object 9026, object angle x(9026),object angle y(9026)+gradi_rotat_timone#,object angle z(9026)



Now my rudder is ready and when I try to rotate it so the rudder start to rotate where I want and I obtain no problems except one:

The darkDynamix collision shape is not offset as the visible DBPro object.
Sothe DBPro rudder is rotating as a door but its counterpart, the DarkDynamix shape, is rotating in his x0,y0,z0 pivot.

See the attached pic please.

So, can I obtain my darkdynamix shape of the rudder is offset as my DBPro object rudder?
If not, can you all help me to find a trick to make this?

Attachments

Login to view attachments
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Jan 2013 13:49
Have you tried: DYN SHAPE SET LOC POS

Also, you seem to be setting the object up with physics and then manually altering the object rotation yourself:
rotate object 9026, object angle x(9026),object angle y(9026)+gradi_rotat_timone#,object angle z(9026)

When you hand the object over to the physics then you are best only using physics commands to control the collision shape which will in turn update your dbpro object.

You could also not worry too much about the collision shape not moving, you would never notice if it ever does collide with anything, unless you plan on doing wind tests or something where particles flow around the plane?

If you provide the plane model, or even better, each part as a separate model I will take a look at it for you?

Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 30th Jan 2013 17:18 Edited at: 30th Jan 2013 17:25
Hi Matty H,


Quote: "Have you tried: DYN SHAPE SET LOC POS"

I tried to use DYN SHAPE SET LOC POS but I just change the DarkDynamix shape position from the DBPro object, not the PIVOT of the DarkDynamix shape.

Quote: "Also, you seem to be setting the object up with physics and then manually altering the object rotation yourself:
rotate object 9026, object angle x(9026),object angle y(9026)+gradi_rotat_timone#,object angle z(9026)
"

All the airplane parts are DarkDynamix objects and I change the rotation of the tail surfaces using this code:

You can notice I apply the rotation of both the DBPro object and his DarkDynamix shape. I need both If not I get only the rotation of the DBPro object or the DarkDynamix shape. If I want to rotate both DBPro object and DarkDynamix shape so I need to use these 2 commands.

Quote: "When you hand the object over to the physics then you are best only using physics commands to control the collision shape which will in turn update your dbpro object."

I need to use the above code just 'cause my tail surfaces are joined to the airplane.
If I try to rotate these surfaces using physic forces so I get the rotation of the full airplane, not the only tail surfaces.
My objective is to rotate just the tail surfaces.

Quote: "You could also not worry too much about the collision shape not moving, you would never notice if it ever does collide with anything, unless you plan on doing wind tests or something where particles flow around the plane?
"

Ehhh please take a look to this youtube vid:
http://www.youtube.com/watch?v=bAAdE7V-h_8&feature=youtu.be

You can notice I need maximum precision about collision 'cause my airplane is inside an "atmosphere" of air particles.
The roll, pitch and yaw of my airplane start using the friction of the airplane (including the movable surfaces) on the air particles (plus some aerodynamics math)


Quote: "If you provide the plane model, or even better, each part as a separate model I will take a look at it for you?"

Yeah thank you very much! Today I will prepare a code where my airplane parts are ready to be joined togheter for you.
I would give you all the code as well but I think you will find a lot of problems to understand it without getting mad..
Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 30th Jan 2013 18:19 Edited at: 30th Jan 2013 18:20
EDIT:

Ok Matty H, here the full project, reduced just to have the airplane just assembled and his rudder rotable using left and right keys. (mouse to rotate and move camera)

http://bitshare.com/?f=tyo0jc25


My goal would be to be able to rotate the rudder and to mantain the rudder DarkDynamix shape correctly fitted with the DBPro rudder object!

You can notice (thx to debug render) I already use offset command to DBPro rudder object (to obtain his rotation as a door rotate in his hinges)and you can see that his DarkDynamix shape pivot remained at x0,y0,z0, loosing his coordination with the DBPro object.
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 31st Jan 2013 14:12
Hi Alduce,

I can run the exe but I can't compile the project, 'undefined parser error'. So I can't change anything to try things out.

What you have is pretty good so far.



I thought that setting the shapes local position would do the trick, what happens when you try this?
Your immediate problem is not the rotation but the fact your physics shape is not in line(offset) with your object. If you get it offset correctly the rotation should then work correctly.

You may also want to try disabling the fixed joint for 9026, then rotate and position the object and actor manually every loop. The fixed joint constraint could cause issues when manually rotating/positioning an actor.

If you can't figure it out then send me a simpler project with just a couple of objects which replicates the issue, thanks. Just attach it to a post, I had to jump through lots of hoops to download your project

Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 31st Jan 2013 15:11 Edited at: 31st Jan 2013 15:13
I hope I upload a right version.. my PC desktop is pure kaos...
And I will make a super simple version without x objects and strange things to let you can use it easly and without problems

About the DYN SHAPE SET LOC POS command, I think vids are better than my poor english!

NOT USING the DYN SHAPE SET LOC POS command:
http://www.youtube.com/watch?v=s7EP8J2RfYY&feature=youtu.be

USING the DYN SHAPE SET LOC POS command:
http://www.youtube.com/watch?v=0ULebAL95Fg&feature=youtu.be

You can notice when I use the DYN SHAPE SET LOC POS command so I get my DarkDynamix shape fit right his DBPro counterpart.. since you don't start with the rudder rotation..
Once the rudder rotation start so you can see the DarkDynamix shape pivot is not affected by the DYN SHAPE SET LOC POS command and is different from the DBPro counterpart pivot.

Quote: "
You may also want to try disabling the fixed joint for 9026, then rotate and position the object and actor manually every loop. The fixed joint constraint could cause issues when manually rotating/positioning an actor.
"

I already tried something similar with very poor results..
But I think by today I will try some other tests about.
I need just some miracolous trick to avoid to getting mad!..
Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 31st Jan 2013 20:28
EDIT:
Here the code to make some tries to solve the offset problem between the DBPro objects and their DarkDynamix shapes.
No media or X objects.

Mouse for move camera and left and right key to rotate the rudder!

Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 1st Feb 2013 22:20
Thanks Alduce, I will put some time aside tomorrow to have a good look at this.

Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 2nd Feb 2013 10:09
Quote: "Thanks Alduce, I will put some time aside tomorrow to have a good look at this."


Thanks to you for support! and take all the time you need, no hurry here.
Matty H
11
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Feb 2013 16:16 Edited at: 2nd Feb 2013 16:26
The following code works.



Just some small changes:
- Changed joint from fixed to hinge
- Rotate actor globally, not locally.

I have put notes in the code. Now you have the joint set up correctly it might be worth looking into joint limits and steering the rudder with the joint motor commands. Rotating the actor yourself is not recommended for a stable simulation although it might be ok for your needs.

Thanks for taking the time to provide clear example of your problem without any media

EDIT:

Rotating actor globally is not an option I'm afraid, you will have to use joint commands or add forces to your rudder to move it.

Problem with setting the global rotation is that it then ignores the rotation of the plane body

Alduce
16
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 3rd Feb 2013 10:44 Edited at: 3rd Feb 2013 10:47
Matty H I would to tell Thank you very much for help!
I am aware I am really on the edge of DarkDynamix (and DarkBasicPro)usage due to my poor programmation skill but with your and other guys help so I reached, since now, something really near from what I would to obtain and, believe me, this is a pure win

Thanks again for now!

Login to post a reply

Server time is: 2019-10-14 14:23:56
Your offset time is: 2019-10-14 14:23:56