Jump to content

BrokenPillar

Members
  • Posts

    92
  • Joined

  • Last visited

Everything posted by BrokenPillar

  1. so oildrum.dds is 171 KB. If I open it in Photoshop and save it using DXT5 and then re-open it, it now has a blank alpha channel and goes up to 342 KB (the same size as oildrumdot3, which I would expect since that one has an alpha that is used for the spec map). Am I still missing something? is DXTC5 something different than DXT5? I don't get an option for DXTC5 with the Nvidia plugins for Photoshop, just DXT5.
  2. Is there a reason or gain from saving a texture without alpha channel information using DXT5? As far as I understand, if you save a texture without alpha information as a dtx5 it just creates a blank alpha channel and increases the file size.
  3. If you are meaning that we can try to mix and match from each pack to make one pack, here are my choices (sorry, I don't know my guns very well so I thought images would be more useful): If not, the pack with the most picks for me turned out to be 10.
  4. DJDD, I kind of figured that was the problem, I just didn't know how to solve it. Fredrik was able to point me in a direction that I was able to get working. Josh, Thanks for the tip. I will look into those commands and see if I can figure them out. Thanks again for the help. I have spent some time trying to learn on my own by reading through several forum threads and this seems to be a great community.
  5. Thanks Fredrick, I played around with that a little and got it to work with my model, but I had to change it a little. Here is the new part to my script: function object:UpdateJoint() self:ClearJoint() if self.hinge~=nil then self.door=LoadModel("abstract::x_stove_01_Door01.gmf") Rot=self.model:GetRotation(1) self.model:SetRotation(Vec3(0,0,0)) self.door:SetPosition( self.hinge:GetPosition(1) ) self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1),Vec3(1,0,0)) self.joint:SetLimits(0,60) self.model:SetRotation(Rot) self.door:SetRotation( self.model:GetRotation(1),1 ) self.door:SetPosition( self.hinge:GetPosition(1) ) end end The only major difference between this and yours was that I had to add the self.door:SetPosition( self.hinge:GetPosition(1) ) line twice to get the door to stay in the right position. I am not really sure why, but I have to have both instances in the exact sequence they are in, otherwise the door ends up in completely the wrong position relative to the stove. Anyway, this works for me now. If anyone sees anything obviously inefficient or has any other feedback on it please let me know, otherwise this will be the method I use going forward. Thanks again.
  6. Hello all, I am new to the forums, but have been playing around with Leadwerks for about 6 months or so. My experience is in 3D modeling, texture creation, and world building, but I am trying to learn a little about Lua scripting. My capabilities are pretty much limited to taking existing examples, picking them apart, splicing them together, and tweaking them to try and achieve the result I am going for. I recently started playing around with hinges and have had pretty much been able to figure them out with the locker example except for one problem. Right now, anytime I place a hinge that runs vertically (like a door) it works great. When I place one horizontally however, I run into a problem (like an oven door, or a toilet seat). In this case, the hinge only works correctly when the model is aligned to the hinge axis. If I rotate the model, the door rotates with it, but the hinge still tries to rotate toward the global hinge axis. Here is my lua script: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function object:ClearJoint() if self.door~=nil then self.door:Free() self.door=nil self.joint=nil end end function object:UpdateJoint() self:ClearJoint() if self.hinge~=nil then self.door=LoadModel("abstract::x_stove_01_Door01.gmf") self.door:SetPosition( self.hinge:GetPosition(1) ) self.door:SetRotation( self.model.rotation ) self.door:SetMass(1) self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1), Vec3(1,0,0) ) self.joint:SetLimits(0,60) self.door:SetCollisionType(COLLISION_PROP) end end function object:Reset() self:UpdateJoint() end function object:Free(model) self:ClearJoint() self.super:Free() end function object:Init() self.model:SetCollisionType(COLLISION_PROP) self.hinge=self.model:FindChild("doorhinge") self:UpdateJoint() end object:Init() end And here is the result. The object on the left has not been rotated in the editor, the object on the right has. My understanding of the script is limited, but I think the problem is in this line: self.joint = CreateJointHinge( self.model, self.door,self.door:GetPosition(1), Vec3(1,0,0) ) or more specifically the Vec3(1,0,0) value. This is a fixed orientation with respect to the world and not the model, right? What I need is for the hinge axis to adjust with the rotation of the model. Is this possible, and if so what would the code look like to accomplish it? Please feel free to give any advice on the rest of the script as well if I am doing anything else wrong or inefficiently.
×
×
  • Create New...