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.

AppGameKit Classic Chat / Convex Hull Decomposition App for 3D Physics

Author
Message
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 18th Nov 2015 19:11 Edited at: 30th Dec 2015 16:00
I am working on a AppGameKit app that will automatically create a compound collision shape for an object using the V-HACD algorithm.
For those who are not familiar with Convex Hull Decomposition or why you would use it I will explain.
The Bullet Physics Engine used by AppGameKit for 3D physics uses collision shapes to represent the objects that you apply physics too.
The collision shapes are a simplified version of the object. Besides the basic primitive shapes you can have a convex hull shape
represent your object and these can all be dynamic objects. If the object has some concavity like the dumpster pictured below, a
primitive or convex hull will not give you a collision shape which will represent the concavity. The Bullet Physics Engine allows you to create
a compound collision shape to represent the object. To create a compound collision shape manually is difficult so this app will create the
compound shape made of convex hulls automatically based on the geometry of the object. The way the app works is you load the object in the app
and adjust a couple of parameters for the V-HACD algorithm then run the decomposition on the object. Then you can see how the object reacts to the
physics and view the collision shapes so you can decided if this is the 3D physics representation you want. You can then save the compound collision shape
in a Bullet Collision Shape (.bcs) file which can be loaded by AppGameKit using the LoadObjectShape() command and applied to the object.

12/13/2015
Released a demo you can download here.
http://www.stabinthedarksoftware.net/AGK_Forums/CHD_APP1.03.zip

The coffee is lovely dark and deep,and I have code to write before I sleep.
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 18th Nov 2015 19:40
cool! the more tools available the better!
www.sheldonscreations.com
haliop_New
User Banned
Posted: 18th Nov 2015 20:31
wow thank you for sharing.
will you give it for free or ?...
whats the plan ?
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 19th Nov 2015 02:42 Edited at: 19th Nov 2015 02:43
would this work for a level scene also? for example my scene consists of one object but is made of many polygons. what id like to do is load my hi poly scene in but load a dummy low poly static object just for the collisions to take place on.

id pay for this! as it would be a very useful tool.
www.sheldonscreations.com
haliop_New
User Banned
Posted: 19th Nov 2015 06:25
same here , SHUT UP AND TAKE MY MONEY !!!!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 25th Nov 2015 14:45
This reminds of the CSG work done for FPSC back in the day (when the quad-tree thing was being worked out). I'd love to see a set of CSG commands in AGK. Realtime object destruction! Woohoo! I guess we could do it with memblocks for now if we really wanted.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 26th Nov 2015 20:20
Here is a video showing the development so far.

The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Nov 2015 22:26

Looking good!
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 1st Dec 2015 16:14
Are we likely to see convex hull decomposition commands built into AppGameKit, or is this going to be a seperate app used to build complex physics shapes that we can import into our projects? Thanks!
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 1st Dec 2015 18:19
Quote: "Are we likely to see convex hull decomposition commands built into AppGameKit, or is this going to be a seperate app used to build complex physics shapes that we can import into our projects? Thanks!"


I do not think it would be practical to build it into AGK. It might add unnecessary weight to the apps.
Currently it is a separate app that will export a collision shape that can be loaded by AGK.
One example of use would be creating good collision shapes for vehicles.

I am finalizing a demo app so the community can test.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2015 00:19 Edited at: 16th Dec 2015 20:48
Today we are releasing the Alpha demo of the Convex Hull Decomposition App.
A new feature is the ability to change the center of mass of the object before performing the convex hull decomposition.
The center of mass will be saved in the collision shape file.
There is a readme file for keyboard shortcuts.

http://www.stabinthedarksoftware.net/AGK_Forums/CHD_App1.01.zip
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Dec 2015 08:34
Good to see this project moving forwards. I loaded a 3ds spaceship but the app crashed when I hit RUN.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2015 12:50
Does it only crash with one particular model?
Have you tried other models other than .3ds?
Could you try a .x file?
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Dec 2015 13:42
Grabbed a .x model at random (it's a door from FPSC - attached) and still get a crash when hitting run.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2015 16:12
Thanks for testing. I cannot duplicate the crash but It seems it might be the progress bar window causing the crash.
What operating system are you testing on?
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Dec 2015 16:35 Edited at: 14th Dec 2015 17:09
Quote: "What operating system are you testing on? "


Win 7 Pro 64Bit

This is how far it gets (crashes almost immediately after hitting RUN):

(I uploaded progress.png as an attachment, but when I try to view the attachment I'm just seeing it rendered out as text)
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 14th Dec 2015 19:44 Edited at: 14th Dec 2015 19:45
I have updated the download with a fix.
It seems the progress bar was having a windows messaging problem on some computers.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 16th Dec 2015 07:59 Edited at: 16th Dec 2015 08:02
Hi

It works great here.
But I have a strange issue : with some files, the normals seems to be inversed, and the model is inversed too.
It's very strange, I don't know why I have this bug. Perhap's, it's my CG card or an AppGameKit bug.
It only appears with some .x files.



In some of my code, I set the culling inversed. Do I need to post a bug report to Paul ?

I have some questions :
- how do you do to select the object under the mouse ?
- Do you know a way to move an object with a "character", like your object moves when it hit another object (I guess withCreate3DPhysicsDynamicBody(obj)) ?

Thanks for this tool, it's great
AGK2 tier1 - http://www.dracaena-studio.com
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 16th Dec 2015 13:46
Quote: "But I have a strange issue : with some files, the normals seems to be inversed, and the model is inversed too.
It's very strange, I don't know why I have this bug. Perhap's, it's my CG card or an AppGameKit bug.
It only appears with some .x files."


In the app the models are set to be semi transparent so it is easier to see the red sphere which represents the center of mass location.

Quote: "how do you do to select the object under the mouse ?"

The left mouse button will create a pick joint with the object when it has a physics body.

Quote: "- Do you know a way to move an object with a "character", like your object moves when it hit another object (I guess withCreate3DPhysicsDynamicBody(obj)) ?"


AGK has character controller commands. A character controller can interact with dynamic and static objects.
I am not using the character controller commands in this App just dynamic objects created with withCreate3DPhysicsDynamicBody(obj).

Thanks for testing.
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 16th Dec 2015 20:51 Edited at: 30th Dec 2015 16:01
Uploaded a new version. Fixed a bug in the progress bar that was slowing down the decomposition.
Updated first post with link.

The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 19th Dec 2015 23:47
I am looking for some feedback, has anyone else tried the app?
The coffee is lovely dark and deep,and I have code to write before I sleep.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2015 13:15
BUMP To prevent post being locked.
The coffee is lovely dark and deep,and I have code to write before I sleep.
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 30th Dec 2015 14:32 Edited at: 30th Dec 2015 14:39
I got this error when unzipping the files. See attached image.
-mrradd-

Attachments

Login to view attachments
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2015 14:42
It was coded in AppGameKit Tier 2. It was coded in tier2 because I needed to add the V-HACD Lib
and create a separate window for the progress bars. did you have any problems running the exe?
The coffee is lovely dark and deep,and I have code to write before I sleep.
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 30th Dec 2015 15:05 Edited at: 30th Dec 2015 15:06
Quote: "It was coded in AppGameKit Tier 2. It was coded in tier2 because I needed to add the V-HACD Lib
and create a separate window for the progress bars."

I was initially just curious in what you wrote it in. I thought if it was BASIC, you were a genius being able to manipulate the commands like that haha.

Quote: " did you have any problems running the exe?"

I can run the exe, but the *.x won't unzip properly, and neither will the *.png. It could just be my pc not liking me.
-mrradd-
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2015 15:16
Quote: "
I can run the exe, but the *.x won't unzip properly, and neither will the *.png. It could just be my pc not liking me."


I used the software 7zip to create the zip file, sometimes winzip will refuse to open it properly. In the past I have had
too many problems with winzip so I now use 7zip as it is more reliable and will open more formats.
The coffee is lovely dark and deep,and I have code to write before I sleep.
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 30th Dec 2015 15:35
I'll install 7zip and try it out later.
-mrradd-
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 30th Dec 2015 15:59 Edited at: 30th Dec 2015 16:00
Here is a newer version. I have tested and it will unzip with windows.

http://www.stabinthedarksoftware.net/AGK_Forums/CHD_APP1.03.zip
The coffee is lovely dark and deep,and I have code to write before I sleep.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 31st Dec 2015 09:35
I am getting "This program cannot start because VCOMP100.dll is missing from your computer" with this version.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 31st Dec 2015 13:47
Quote: "I am getting "This program cannot start because VCOMP100.dll is missing from your computer" with this version. "


Your are missing the Microsoft Visual C++ 2010 Redistributable Package. It installs runtime components of Visual C++ Libraries required
to run applications developed with Visual C++ on a computer that does not have Visual C++ 2010 installed.
Here is the link to download.

https://www.microsoft.com/en-us/download/details.aspx?id=5555
The coffee is lovely dark and deep,and I have code to write before I sleep.

Login to post a reply

Server time is: 2024-04-23 07:46:13
Your offset time is: 2024-04-23 07:46:13