Josh Posted December 29, 2009 Share Posted December 29, 2009 If anyone wants to make a desk like below, I will add a script to give it physics. The drawers should be separate pieces. A physics shape needs to be created for the desk and each size drawer you use. Each drawer can be a limb in the mesh file, with a name like drawer1, drawer2, etc. The pivot of the drawer should be in the center rear of the drawer. The drawer physics shape should consider this point the origin...the draw physics shape will be loaded from the .phy file and connected at this point with a slider joint, with limits. After I write the script, you will be able to grab the drawers in the editor and pull them open to see what is inside. It might be easier to just make all the drawers the same, since it will probably be a little confusing to set up at first. This is what got me thinking about this: http://www.youtube.com/watch?v=Ux4OwkS9ybA Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
omid3098 Posted December 29, 2009 Share Posted December 29, 2009 if no one started this, I will make it.. hah? Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
omid3098 Posted December 30, 2009 Share Posted December 30, 2009 ok. I modeled it last night at home. just some questions. I could not exactely understand where to place drawers pivot point? green one or red? and should I export separate drawers and separate desk with their own .phy files? what about LODs? Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 30, 2009 Share Posted December 30, 2009 @Josh: that's so awesome and quite a coincedence. I'm actually working on a script to get the doors to open dynamicly, just like in the Penumbra series. I was planning to do this as well for the drawers you are making now. This script is for the entity or is it an adeption to the fpscontroller? Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted December 30, 2009 Share Posted December 30, 2009 ok. I modeled it last night at home. just some questions. I could not exactely understand where to place drawers pivot point? green one or red? and should I export separate drawers and separate desk with their own .phy files? what about LODs? center of the green is what he asked. Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Josh Posted December 30, 2009 Author Share Posted December 30, 2009 The green one is correct. Just make sure the pivot you add for the drawer in the desk model is in the same place. The type of drawer should be a separate model, with a convex hull .phy file. If any drawers are the same, I can load another copy of the model. Here's what I am going to do in code: drawerpivot=object.model:FindChild("drawer") drawer=LoadModel("abstract::furniture_desk_drawer1.gmf") drawer:SetPosition(drawerpivot:GetPosition(1),1) drawerjoint=CreateJointSlider(object.model,drawer,Vec3(0,0,1) drawerjoint:SetLimits(0,0.6) --or whatever amount looks good The doors in the tunnels scene will open like Penumbra if you just fly up to them in the editor, hold the shift key, and click and drag them with the mouse. I would not worry about LOD at this point. Let's see if this even works first! Looks pretty nice so far. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2009 Author Share Posted December 31, 2009 It actually doesn't matter where on the drawer the pivot is, as long as the tag you place in the desk mesh matches the position of the drawer pivot, so the drawer appears in the right place. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
omid3098 Posted December 31, 2009 Share Posted December 31, 2009 @VicToMeyeZR: thanks almost every one in this forum can speak and understand english better than me! Model is ready. Download MetalDesk GMF format there is 6 drawers as reference image, 4 of them are same but I exported them separately, because their pivot points would be different. All Pivot points are same place Physics are convex hull Source Max file is included Screenshots: Pivot poits: Physics: Download Source Max file If there were mistakes or errors, let me know. thanks. Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2009 Author Share Posted December 31, 2009 Can you make physics shapes using convex hulls? The triangle mesh can't work with dynamic physics. The mesh looks good. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
omid3098 Posted December 31, 2009 Share Posted December 31, 2009 I checked "create *.phy file" and set type to "Convex Hull" in ArBuz Exporter. so I think they should be Convex Hull now.. Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
Marleys Ghost Posted December 31, 2009 Share Posted December 31, 2009 Looks fantastic Omid, really nice 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...
omid3098 Posted December 31, 2009 Share Posted December 31, 2009 thank you MG Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 31, 2009 Share Posted December 31, 2009 Good work Omid, nice texturing as well. Quote Link to comment Share on other sites More sharing options...
omid3098 Posted December 31, 2009 Share Posted December 31, 2009 thanks Aggror. I know it should be better than this, but I tried to make it match with other objects in underground level. @Josh. it seems there is something wrong in Alex exporter. I will fix it using phygen and reupload. one question: can we put something inside drawers using convex hull shape? Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
AggrorJorn Posted December 31, 2009 Share Posted December 31, 2009 @josh or someone else who knows this. I've bin looking today where I can find the code that enables you to open the doors with shift+mousemovent. I can't seem to find it. It's really cool that this already works inengine but I want to see if I can get it to work with the fpscontroller script. Quote Link to comment Share on other sites More sharing options...
omid3098 Posted December 31, 2009 Share Posted December 31, 2009 Sorry for my late, here is new one: physics created using phygen- obj files included- MetalDesk GMF Format OBJ Files Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2009 Author Share Posted December 31, 2009 Drawer 5 and 6 seem to still use triangle mesh collision, so I have them disabled for now. The drawers tend to droop a bit with gravity. This might be due to the way they are positioned. I created the slider joint at (0,0,0) since there are no pivots in the desk mesh to place them. I think the drawers should be centered at their rear center, and then a pivot added to the desk mesh I can use to position them. That might make the slider joint more accurate. Here's the script: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) local joint local n object.model:SetMass(20) object.model:SetCollisionType(COLLISION_PROP) object.drawer={} for n=1,4 do object.drawer[n]=LoadModel("abstract::0d_drawer_0"..n..".gmf",object.model) object.drawer[n]:SetMass(0.1) object.drawer[n]:SetCollisionType(COLLISION_PROP) joint=CreateJointSlider(object.model,object.drawer[n],Vec3(0,0,0),Vec3(0,0,1)) joint:SetLimits(-0.5,0) end function object:Reset() local n for n=1,6 do if self.drawer[n]~=nil then self.drawer[n]:SetMatrix(self.model.mat) end end end function object:Free() local n for n=1,6 do if self.drawer[n]~=nil then self.drawer[n]:Free() self.drawer[n]=nil end end self.super:Free() end end Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted December 31, 2009 Author Share Posted December 31, 2009 You will need to sync before running the script. The CreateJointSlider() command was missing. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
omid3098 Posted January 1, 2010 Share Posted January 1, 2010 oops :/ it seems I missed 5,6 should I change drawer pivot points to their rear center? what about desk mesh pivot point? I set all pivot point in same position for easier to place desk and drawers snap to one point with their correct posiotion. Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
macklebee Posted January 1, 2010 Share Posted January 1, 2010 I could be wrong but I think he wants each drawer model's origin/pivot to be its rear center. And then the desk model will have 6 pivots located where the drawers origins would be if they were closed in the desk. 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...
omid3098 Posted January 1, 2010 Share Posted January 1, 2010 thanks, it seems more logical than my pivots! its not hard to do it right now, its really hard to upload! so I think I should wait for Josh to confirm Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
omid3098 Posted January 1, 2010 Share Posted January 1, 2010 I know it should be better than this, but I tried to make it match with other objects in underground level. Oh my GOD!! believe me, I did not mean, underground models are not good, or I can model better than underground models!! I just spent more time to mach colors and contrast in textures Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) Link to comment Share on other sites More sharing options...
macklebee Posted January 1, 2010 Share Posted January 1, 2010 i don't think anyone thought you meant that... at least i didn't. 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...
Josh Posted January 1, 2010 Author Share Posted January 1, 2010 Oh my GOD!! believe me, I did not mean, underground models are not good, or I can model better than underground models!!I just spent more time to mach colors and contrast in textures Blasphemy! Just kidding. The texturing looks really nice. It seems like it would fit in with a variety of scenes and not look out of place. You can make a drawer shape out of multiple objects. Each object has to be a convex hull, but you can make the phy shape out of multiple convex hulls in one obj file. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
omid3098 Posted January 2, 2010 Share Posted January 2, 2010 You can make a drawer shape out of multiple objects. Each object has to be a convex hull, but you can make the phy shape out of multiple convex hulls in one obj file. can you explain more? do you mean I should export drawer parts seperately and make convex hull phy for each part of each drawer? and how can I make the phy shape out of multiple convex hulls in one obj? Quote Omid Saadat OD Arts Blog AMD Phenom II X4 940 - Geforce 8800GTS - 4GB RAM - XP x86 AMD 6000+ - Geforce 9800 GT - 2GB RAM - XP x86 (Home pc) Intel Core i7 - Geforce 310M - 4GB Ram - Win7 x64 (Laptop) 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.