Jump to content

Phygen ConvexHull


Volker
 Share

Recommended Posts

Hi,

 

I'm pretty disappointed which convexhull phygen created

for my model. The object must be dynamic, so I cant' use collisiontree.

No way to fly through this gate :P

I modelled a simple torus of the same size and created a .phy for it. Doesn't help.

Any workarounds for this?

post-184-12630421885597_thumb.jpg

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

Can you list the workflow for creating the .phy?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Can you list the workflow for creating the .phy?

Got it as wavefront obj. Used phygen (convexhull).

 

The torus I have builded with Milkshape and exported to obj.

Same effect.

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

Got it as wavefront obj. Used phygen (convexhull).

 

The torus I have builded with Milkshape and exported to obj.

Same effect.

 

 

Did you use phygen.exe or obj2phy.exe from the tools folder in the SDK?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

You could skip creating a convex hull, and when you call LoadModel in your game or drag it into the editor, a much more detail .phy file is usually generated.

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

You could skip creating a convex hull, and when you call LoadModel in your game or drag it into the editor, a much more detail .phy file is usually generated.

 

 

 

Very true, also simply loading into the editor will create a .phy only these types are not effected by gravity, but if thats not an issue then it would be simpler.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Used phygen.exe. Tried obj2phy too right now.

Using Leadwerks 2.26.

 

If I drag it in sandbox the phy file created is static (AFAIK it's collisiontree).

Same if I use loadmodel.

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

Tried obj2phy too right now.

Using Leadwerks 2.26.

 

If I drag it in sandbox the phy file created is static (AFAIK it's collisiontree).

 

 

Do you mean the .phy file created with obj2phy? Did you create an .ini file for the model?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Do you mean the .phy file created with obj2phy? Did you create an .ini file for the model?

Ehm, no. I converted the obj to gmf with meshconvert.exe (which creates no phy file).

Then dragged the gmf in sandbox (which then automatically creates a phy file).

Then deleted the phy file again. Used Loadmodel to load the gmf in sourcecode (which creates a phy file).

Both times the phy files look again like in my screenshot.

 

No, what should be in the ini file?

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

Well if LoadModel and loading into the Editor create a .phy file thats the same as the one you have already got I'd suggest looking at the models conversion, also have you tried obj2gmf.exe ?

 

 

The .ini file is where you'd specify a mass for the model. look in the oildrum models folder to see an example.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Also just as an informational point, if you do decide to update from 2.26 to 2.28 ... you will have to redo all your .phy files again, see HERE

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Also just as an informational point, if you do decide to update from 2.26 to 2.28 ... you will have to redo all your .phy files again, see HERE

Good to know. But I'll stay at 2.26 if possible to get my project finished. Then I will go to 2.3 (2.4 :) ).

I do the mass settings directly in code, so I wondered why I should use an ini file..

Tried ob2gmf and then phygen too.

 

As I said, I modelled a simple torus in Milkshape and the phy file although gets screwed up.

http://skopia.de/torusforphygen.obj

 

Looks like phygen doesn't work with this kind of objects.

Thanks for your time guys.

Edited by Volker

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

You need to create a physics shape, export as .obj and convert that physics shape to .phy using the phygen or obj2phy.

What is the difference between a model and a physics shape? nothing appart for the job it is meant to do. A model alone wont have any physics interraction so it can be highly detailed, the physics shape on the other hand needs to be extremely simple. When you convert a model in phygen or obj2phy it will automatically patch it together to the simplest shape possible. A continious torus is a perfect example of how this is no good.

Same if you want to make an inward corner for a pipe, you will need to make it in two or three, perhaps even four cylinders depending on the shape of the bend and how accurate you want your physics to be.

I will provide some illustrations.... and excuse my drawing skills.

 

First lets see what might happen if you make a corner from one single mesh.

2daklg8.jpg

The red line is the resulting physics shape.

The converter will make the most effective physics shape possible, even if that isnt what you want at all.

To make the corner correct, you need to devide that corner up somehow, like this for instance.

15q24hk.jpg

Here the green line is the resulting physics shape, as you can see it now have the corner made correctly. That is because you actually give the converter additional instructions this way.

At least, this is what I needed to do when making physics shapes in the past, for Source (garry's mod) for instance.

 

Hope this helps.

Win7: 3.4GHz i7, 16Gb RAM DDR3, Radeon HD 6970 2048MB

Link to comment
Share on other sites

I've had problems in the past generating phy files from phygen as it always seems to take the models origin into account so anything that is offset from the origin (for example your torus if it has its origin in the center) will generate a convexhull phy structure that covers the hollow space too. In fact even a simple square plane offset from its origin will generate a pyramid shaped convexhull with the origin as its apex. I've found phygen extremly limited in this respect.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Well I just created a torus in AC3D saved as a wavefront .obj .. used obj2gmf.exe and obj2phy.exe

 

Result:

 

phycheck.png

 

 

and with ini and (as I am using 2.3) lua files .. gravity works to.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

obj2phy is a direct conversion to a convex hull, so it should work fine...

52t__nvidia.png nVidia 530M cpu.gif Intel Core i7 - 2.3Ghz 114229_30245_16_hardware_memory_ram_icon.png 8GB DDR3 RAM Windows7_Start.gif Windows 7 Ultimate (64x)

-----

IconVisualStudio16.png Visual Studio 2010 Ultimate google-Chrome.png Google Chrome PhotoshopLinkIndicator.png Creative Suite 5 icon28.gif FL Studio 10 MicrosoftOfficeLive.png Office 15

-----

csharp.png Expert cpp.png Professional lua_icon.png Expert BMX Programmer

-----

i-windows-live-messenger-2009.pngskype-icon16.pngaim_online.pnggmail.pngicon_48x48_prism-facebook.pngtunein-web.pngyahoo.giftwitter16.png

Link to comment
Share on other sites

Will try using obj2phy.exe in future. Thanks MG.

 

 

No problems Pixel :blink: I was actually just trying to recreate Volker's problem but have failed to do so, so I thought I'd just post the results.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Back again. Did some more tests.

Looks like I'm unable to convert even a simple object to a usable convex hull.

Will be a funny game; with all complex objects static :blink:

 

Here is a simple object made in Milkshape and converted with obj2phy:

http://www.skopia.de/forum/simple.rar

And this how it looks like:

http://www.skopia.de/forum/simplephy.JPG

Can anyone convert this succesfull (preferred with the tools from 2.26)?

 

Let's not talk about complexer models:

http://www.skopia.de/forum/stationphy.JPG

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

Using the obj2phy.exe from the 2.26 SDK and your included .obj .. then using that .phy file with your included .gmf dragged into the 2.3 editor

 

 

test89.png

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Using the obj2phy.exe from the 2.26 SDK and your included .obj .. then using that .phy file with your included .gmf dragged into the 2.3 editor

This is getting crazy.

I installed a fresh LE 2.26 on a clean virtual pc, to be sure not to mix files; copied only the

test89.obj to it and converted it with obj2phy. I get a phy file like in my screenshot.

 

Just ordered 2.3 to get behind this mystery.

Edited by Volker

Core2DuoE6570 / Windows7 64bit / 4 Gb RAM / Geforce GTX 260 896Mb / LE 2.3

Dell Inspiron 1720 / Vista SP2 / C2D 2.4 / 8600 GM

Link to comment
Share on other sites

I couldn't help but feel MG when looking at your pic that it looked more like a collision tree physics mesh than a convex hull, so I tried it myself using Volkers obj model. Using the latest 2.3 toolset I converted the obj file to gmf and placed it in the Editor with no phy file. The autogenerated collision tree looked identical to the pic you posted. I then generated a new phy file using the obj file and obj2phy.exe and replaced the original auto generated one. I now get exactly the same collision mesh as Volker. Pic below (and the end of my picture quota by the looks of it unsure.gif ):

post-51-12631572269118_thumb.jpg

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

I repeated the process using the supplied .obj to generate both the .gmf and .phy using the tools in my backup 2.26 SDK, 2.26 as requested, as volker is not using 2.3 tools. The result is still as per pic I posted.

 

Using the 2.3 tools in the Current SDK the result is as per pic you posted above.

 

 

Using AC3D to generate a range of shapes exported to .obj I can't reproduce the error no matter which method. Maybe its an issue with Milkshapes .obj exporter? I don't have milkshape so cant test that. ;)

 

 

Yes the 500k limits a little small ... am using image shack at the moment to use pics for trouble shooting.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

A convex hull has all its face normals facing outwards, so that no face normals ever intersect eachother.

That's why you get those "shortcuts" over faces which are not convex, like on the lower left corner of the last pic.

So the last pic is a correct convex hull, the first pic is a binary tree hull.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...