VeTaL Posted August 27, 2010 Share Posted August 27, 2010 I have a model of the tower, i dont want to make convex hull phys-body for it, i just want box phys-body. But how can i make it? If i select Box in PhyGen, i got only a small box, but i want a box with the size of tower. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 27, 2010 Share Posted August 27, 2010 you just have to play around with the setting until you get something you like... so create a box phy file using phygen and set the Scale up with setting like 1,20,1... or whatever until it approximates the size of your model Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted August 27, 2010 Author Share Posted August 27, 2010 but position, rotation and scale fields are not editable. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 27, 2010 Share Posted August 27, 2010 but position, rotation and scale fields are not editable. yeah they are... collision type set to box... and i am able to change all of the other settings... here's one i just made that has the Yposition offset +10 and the Yscale set at 20... you will need to have Show Physics on in the editor to see it.. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted August 27, 2010 Share Posted August 27, 2010 same here position, rotation and scale fields work. 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...
Ywa Posted August 27, 2010 Share Posted August 27, 2010 What he means is that he wants to automatically generate a phy file based on the model's bounding box.. Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 27, 2010 Share Posted August 27, 2010 where do you get that from when he was asking about phygen in his original post? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted August 27, 2010 Author Share Posted August 27, 2010 When i select "convex hull" or "collision tree", the string of path is active, but when i select "box", its not active. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 27, 2010 Share Posted August 27, 2010 yeah... thats because you are not trying to load an OBJ file to create your PHY file but make a PHY file based on primitive shapes... set the collision type to box then set all of your settings for position, rotation, scale... then hit the OK button and a dialog window will open up and let you save the phy file to whatever name you want... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted August 27, 2010 Author Share Posted August 27, 2010 //set all of your settings for position, rotation, scale Okay, but how can i get size of my tower? How can i know, if it is 1;2;1, or 2;7;2 ? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 27, 2010 Share Posted August 27, 2010 well you can always eyeball it in the editor with the grid on... or just play around with it... a value of 1 in the position or scale setting is equal to 1 meter in the LE editor... or if you can tell your dimensions in your modeling app, then use those... like i said its something that you have to play around with... it would be nice though if the Editor had grids available for the XY and YZ planes so you could easily see the dimensions based on the grids Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 I think, it would be nice to create Phy-body from bounding box of the mesh. Okay, macklebee, thanks, i'm going to play with that variables (not with my balls, as somebody from ball demo said xD ). Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 28, 2010 Share Posted August 28, 2010 yeah it could probably be done but seems a bit overkill when you can quickly and easily test different PHY bodies from phygen with Show Physics in the editor... granted it would help that the Editor didnt have to be stopped and restarted between different PHY files... worse case you could always just write a small program that lets you load a model and it gives you the bounding box information to use in phygen... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 Yep, btw, i have an idea to create a template-folder with some templates: LUA+SKY, character controller, FPS camera, TPS camera and so on. But, in general, i wish to have an option "build phy-file by bounding-box" Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 28, 2010 Share Posted August 28, 2010 well the phygen code is available in older sdk's... like i said you could always write your own app... one that loads the model, determines the bounding box data and convert it to appropriate values, then save the phy file from there... something like that might be useful to the community. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
cassius Posted August 28, 2010 Share Posted August 28, 2010 I use my bmax program with debugphysics switched on along with pjygen, but as mack indicates its a matter of trial and error and you improve with practise. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 I did the same in Newton For 3DGameStudio wrapper... Maybe, i'll do the same for community and me tomorrow B) Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Mumbles Posted August 28, 2010 Share Posted August 28, 2010 I see no reason for not using convexs everywhere. If need be, make your .obj a plain box the size you want it. Using raw newton, it's much easier to write a helper function to create: Convex hulls, compound collision, and tree collision and then never bother with the primitives. The primitives are more trouble than they are worth, since you can create them out of convex hulls anyway. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 //I see no reason for not using convexs everywhere. Why? Wouldnt it be more hard for Newton? As i have middle-age wall in box and convex - in convex there are a lot of useless vertices. I just do as you reccomend: i enable physics debug in editor, generate new phy-file from box and see what i get in editor by adding model. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Mumbles Posted August 28, 2010 Share Posted August 28, 2010 For a simple box shape, I just export a box as an obj from my modeller. That way I never make any collision shapes in code. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 Again problems... What a bad day... I load level with that towers TEntity scene=LoadScene(_SCENE_FILE_NAME_); EntityType(scene, 1); enable collisions Collisions(1,1,1); Collisions(1,0,1); Collisions(0,1,1); // just for sure load player and set Type for him _player = CreateController(1.8,0.4,0.5,45.01); EntityType(_player,1); SetBodyDamping(_player,0.0); SetBodyMass(_player,1); but still dont have collisions with walls... //That way I never make any collision shapes in code. Why not: you know parameters of the BBox, so you can create the same box in code. Btw, it would be nice to load phy-files. Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 28, 2010 Share Posted August 28, 2010 try it without the Collisions(1,0,1) and the Collisions(0,1,1)... There is no collisiontype zero. (Well there is... but it means whatever is set to that doesn't have a collision type) and you can load PHY files... LoadBody() but as long as the PHY file has the exact same name as the model it will automatically load... if none of that works, you could always just set the collisiontype via the lua object script then you wouldn't have to set the scene's collisiontype... also in LE, I believe controllers are usually collisiontype 3 (COLLISION_CHARACTER)... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Mumbles Posted August 28, 2010 Share Posted August 28, 2010 For bodies to collide they need to be inside the world (link) This is normally the cause. Also bodies outside the world will not react to forces either. Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
VeTaL Posted August 28, 2010 Author Share Posted August 28, 2010 //try it without the Collisions(1,0,1) and the Collisions(0,1,1)... There is no collisiontype zero. I tried, but result is the same. //but as long as the PHY file has the exact same name as the model it will automatically load... Yep, even more: as i change phy files, i can see another shape in physic debug, so they may be loaded correctly. //For bodies to collide they need to be inside the world (link) But character collides with terrain, so collisions may work. //also in LE, I believe controllers are usually collisiontype 3 (COLLISION_CHARACTER)... Changed to EntityType(_player,3); and Collisions(1,3,1); Collisions(3,1,1); Still the same Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
macklebee Posted August 28, 2010 Share Posted August 28, 2010 are you using lua scripts with your program? just curious... because if you are then there's no reason to set the collisions or set the scene's collisiontype in the program because it should automatically load the collisions.lua file... dunno... just out of curiosity, can you load the scene in the editor and run the fpscontroller game script and have collision with the walls? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel 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.