Placement question

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Placement question

Postby Bird » Tue Mar 25, 2014 3:25 pm

Hi Julio,

My project gives the user 2 choices for placing a mesh onto another. One choice is RayCast where a ray is fired from the mouse into the scene and the body is placed according to user settings at the ray hit point. The second choice is called ConvexCast and it fires a mouse ray to find the hit spot and then uses NewtonWorldConvexCast() to cast the body along the path from the mouse to the hit spot, stopping when there is contact.

Both methods have their problems. RayCast has penetration problems when adjoining polygons are concave and ConvexCast often leaves the mesh offset from the surface in unnatural ways.

Here's a little video that shows what I mean. http://www.hurleyworks.com/media/flash/AP_Placement_Options/AP_Placement_Options.html

In the last part of the video, I got the box to sit properly by Stepping through the engine. I was wondering if there is a way I can compute the last result without having to step through the engine?

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Placement question

Postby Julio Jerez » Tue Mar 25, 2014 6:14 pm

Ok I saw the video.
I think one way to do that is just teh same way you did it by the end. I cn anot thnkl of any oethe pactical way because even if say you fidm teh first contact, and the you do a recursive cats tha find teh secudn contact it still have the big problem of find the proper aligment.

on way would be use the same mechanism that CCD uses.
Bascally CCD in newton work like this.

when a body has the CCD flag on, the engine monitor the island the is of all bodies interconeted to that bodies dirently or inderectly.
then that island is integrated independely as follow
Code: Select all
repeat until remind time step is zero
      calculate time of impact,
       advance islan until time of impact
      subtract time of impact from time step


This not exposed to the end user, by there is not reason why not.
one way can be providing a way to integrate a subset of bodies, an integrate those

at teh end of teh video, are you still manipulating the object, or you just let it fall under gravity?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Placement question

Postby Bird » Tue Mar 25, 2014 6:30 pm

at teh end of teh video, are you still manipulating the object, or you just let it fall under gravity


At the end of the video, I am just single stepping Newton so that gravity brings it down to rest on both surfaces properly. But I'd like to be able to get the same result without having to have the engine running, since the user is just interested in placing that one mesh and doesn't want anything else to move.

This not exposed to the end user, by there is not reason why not.

That would be great if you could make that available to us!

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Placement question

Postby Julio Jerez » Sat May 17, 2014 1:11 pm

about tow month ago, You asked me to complete a collision function. But I do no remember which one it was, can you remind me again?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Placement question

Postby Bird » Sat May 17, 2014 3:15 pm

Julio Jerez wrote:about tow month ago, You asked me to complete a collision function. But I do no remember which one it was, can you remind me again?


Hi Julio,

It was NewtonCollisionClosestPoint with compound shapes. Would be great if you could get that working!

http://newtondynamics.com/forum/viewtopic.php?f=26&t=8598

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Placement question

Postby Julio Jerez » Mon Jul 07, 2014 11:47 am

Ok I resume work on the engine again.
I am working and a couple of features that I need to complete, (the vehicle, the ragdoll joint, and the double precision project) after that I will address this issue, this intrigue me, and I have to come up with some clever smart solution.

My inclination is that the solution to this is not just a single convex cast, It has to be an iterative loop that solve a complementarity equation.
Basically the solver will calculate a rotation matrix, and try the cast again.
If the cast find another contact set, that it will try another rotation matrix.

This process continues, until one of two thongs happens.
1-the number of iteration is exhausted.
2-The matrix set of contact generate a stable equilibrium position

This problem is similar to what a player controller does when it hit a corner.

Isa is a interesting challenge but I believe is can be solve quite nicely, and will make you plug-in very cool.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Placement question

Postby Bird » Mon Jul 07, 2014 1:55 pm

That's the best news I've had in a long time. :)

Thanks!

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Placement question

Postby manny » Mon Jul 07, 2014 5:05 pm

Julio Jerez wrote:Ok I resume work on the engine again.

Glad to hear that. I think I've already said it, but I think the project would profit highly from switching to github from google code.
This will allow other developers to easy submit pull requests (patches), a great issue tracker plus knowledge of users that fork your code.
If you don't want to do the migration, I could help you out, so you'd just have to sign up with github.

There are more features that would be great! If we could use newton for inverse kinematics coupled with character controllers that would be awesome. This is something that is on our roadmap, and it would be great if we could use newton for this and not have to roll our own solution.

I am working and a couple of features that I need to complete, (the vehicle)

I assume you're talking about the rigid body based vehicle? What about a ray-cast vehicle for a simpler, more lightweight simulation.
Right now we're working on a game for mobile devices and because of performance reasons, we've implemented ray-cast cars using a "UserJoint" and several linear restrictions for each wheel point. However, I think that you could implement such a car in a much better fashion.
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: Placement question

Postby Julio Jerez » Tue Jul 08, 2014 9:06 am

Yes I know, this vehicle is Mutibody yes. I will try to complete this first and then I will dust up the old core raycast car and make a simple one joint friction car
The cool thing about the vehicle system is that it can implement different vehicle type, so there will be the Mutibody, but late I will add the raycast single joint, Tanks, and airplanes. maybe a helicopter
the hard one is the wheel vehicle, because require lot of tweaking
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Placement question

Postby manny » Tue Jul 08, 2014 3:41 pm

Julio Jerez wrote:Yes I know, this vehicle is Mutibody yes. I will try to complete this first and then I will dust up the old core raycast car and make a simple one joint friction car
The cool thing about the vehicle system is that it can implement different vehicle type, so there will be the Mutibody, but late I will add the raycast single joint, Tanks, and airplanes. maybe a helicopter
the hard one is the wheel vehicle, because require lot of tweaking

Cool. If you want, I can send you our code for the single joint raycast car.
Airplanes and helicopters? That would be awesome!

But... what about a github migration :) ?
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: Placement question

Postby Julio Jerez » Tue Jul 08, 2014 5:21 pm

manny wrote:Cool. If you want, I can send you our code for the single joint raycast car.


Ok, I can integrated as a Vehicle type on the vehicle manager, and we can start we two model already.
That will be very nice.
On the Guihub, when I when to the website, it say that it charge 7 at month for hosting.
I do not make any money on newton.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Placement question

Postby d.l.i.w » Wed Jul 09, 2014 4:07 am

Github charges money for private repos only, public repos (as Newton would be) are free.
Downloads are supported, too (basically by tagging commits and mark tags as Release).

A quite similar alternative is BitBucket.

As far as issue tracking and "interaction" (patches / pull requests, commenting, ...) is concerned both are superior to Google Code.
Unfortunately one looses svn's nice revision numbers - might be a disadvantage.
d.l.i.w
 
Posts: 81
Joined: Mon Sep 26, 2011 4:35 am

Re: Placement question

Postby manny » Wed Jul 09, 2014 5:56 am

Julio Jerez wrote:
manny wrote:Cool. If you want, I can send you our code for the single joint raycast car.


Ok, I can integrated as a Vehicle type on the vehicle manager, and we can start we two model already.
That will be very nice.

Okay, I'll extract the code and send it to you. You might have to do some refactoring though, as it's heavily integrated in our engine.

On the Guihub, when I when to the website, it say that it charge 7 at month for hosting.
I do not make any money on newton.

It's free for public repositories with all features. I can setup the repository for you, it should even include the SVN history.
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: Placement question

Postby manny » Wed Jul 09, 2014 7:36 am

manny wrote:I can setup the repository for you, it should even include the SVN history.

Okay, I am currently setting up the github repository, however the upload should take a while as it's huge because of the entire svn history! Once I am done and you are familiar with github I can transfer ownership to your account.
It might be wise if we just truncate the history and go from there and keep the google SVN as a historical backup, right now the github checkout will is huge.

As a next step I would recommend directly redirecting from newtondynamics.com to github's wiki (that's how most projects handle this these days see http://www.emscripten.org). But keep the forum alive and link to it from the repo's readme and wiki. This should reboot newton dynamics and give it a fresh start.
We should also migrate the "mediawiki" to github, I can do this if you give me read access to the mediawiki ftp/files, or simply send me a zip file containing a sitedump. Basically I need access to all mediawiki sourcefiles to migrate it to github.

Julio, please sign up on github as "Julio Jerez" with the same email you've used on google code i.e. je...io0@gmail.com (yup i've skipped the middle part) then github should be able to match the git history with your account! Also, let me know when you are done so I can add you to the newton dynamics dev team with write access.

The repository should arrive at https://github.com/MADEAPPS/newton-dynamics in a few minutes. I'll let you know.

EDIT: it's done! the migration to GitHub is complete, I've already setup a nice readme and license file and prepared a wiki page.
Julio, please try to avoid further commit to the svn repo :)
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
Site Admin
 
Posts: 131
Joined: Tue Feb 11, 2014 6:49 pm

Re: Placement question

Postby AntonSynytsia » Wed Jul 09, 2014 9:54 am

Manny, the repo at github look beautiful. Juleo must see it 8)
AntonSynytsia
 
Posts: 193
Joined: Sat Dec 28, 2013 6:36 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron