Volker Posted January 9, 2010 Share Posted January 9, 2010 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 I modelled a simple torus of the same size and created a .phy for it. Doesn't help. Any workarounds for this? Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 Can you list the workflow for creating the .phy? Quote 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 More sharing options...
ArBuZ Posted January 9, 2010 Share Posted January 9, 2010 I think that phy shape should consist of a few simple convex hulls. Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com Link to comment Share on other sites More sharing options...
Volker Posted January 9, 2010 Author Share Posted January 9, 2010 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. Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 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? Quote 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 More sharing options...
TylerH Posted January 9, 2010 Share Posted January 9, 2010 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. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 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. Quote 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 More sharing options...
Volker Posted January 9, 2010 Author Share Posted January 9, 2010 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. Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 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? Quote 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 More sharing options...
Volker Posted January 9, 2010 Author Share Posted January 9, 2010 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? Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 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. Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 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 Quote 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 More sharing options...
Volker Posted January 9, 2010 Author Share Posted January 9, 2010 (edited) 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 January 9, 2010 by Volker Quote 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 More sharing options...
Jardar Posted January 9, 2010 Share Posted January 9, 2010 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. 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. 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. Quote Win7: 3.4GHz i7, 16Gb RAM DDR3, Radeon HD 6970 2048MB Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 9, 2010 Share Posted January 9, 2010 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. Quote 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 More sharing options...
Marleys Ghost Posted January 9, 2010 Share Posted January 9, 2010 Well I just created a torus in AC3D saved as a wavefront .obj .. used obj2gmf.exe and obj2phy.exe Result: and with ini and (as I am using 2.3) lua files .. gravity works to. Quote 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 More sharing options...
TylerH Posted January 10, 2010 Share Posted January 10, 2010 obj2phy is a direct conversion to a convex hull, so it should work fine... Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 10, 2010 Share Posted January 10, 2010 Will try using obj2phy.exe in future. Thanks MG. Quote 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 More sharing options...
Marleys Ghost Posted January 10, 2010 Share Posted January 10, 2010 Will try using obj2phy.exe in future. Thanks MG. No problems Pixel 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. Quote 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 More sharing options...
Volker Posted January 10, 2010 Author Share Posted January 10, 2010 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 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 Quote 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 More sharing options...
Marleys Ghost Posted January 10, 2010 Share Posted January 10, 2010 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 Quote 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 More sharing options...
Volker Posted January 10, 2010 Author Share Posted January 10, 2010 (edited) 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 January 10, 2010 by Volker Quote 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 More sharing options...
Pixel Perfect Posted January 10, 2010 Share Posted January 10, 2010 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 ): Quote 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 More sharing options...
Marleys Ghost Posted January 10, 2010 Share Posted January 10, 2010 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. Quote 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 More sharing options...
Canardia Posted January 10, 2010 Share Posted January 10, 2010 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. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Recommended Posts
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.