Kronos Posted September 13, 2012 Posted September 13, 2012 I don't know if such a thing is possible but it would be helpful for the model editor I'm working on. At the moment scale seems to be getting messed up when parenting entities. Quote intel i5 2500k, ram 16gb, nvidia Geforce GTX570, asus xonar sound card. Windows 7 64 bit
macklebee Posted September 14, 2012 Posted September 14, 2012 Well it sounds more like an issue with how you are parenting than a problem with needing a global parameter for scaling. If you set the global parameter for EntityParent to a 0 (indicating local), then the child will scale to the parent's scale. If you set the parameter to a 1, then the child will maintain its scale regardless of the parent's scale. require("Scripts/constants/engine_const") RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() fw.main.camera:SetPosition(Vec3(.5,1,-4)) mesh1 = LoadModel("abstract::firepit.gmf") mesh1:SetScale(Vec3(.5,.5,.5)) mesh2 = CreateCube() mesh2:SetParent(mesh1, 0) mesh2:SetPosition(Vec3(-1,1,0),1) mesh3 = mesh1:Copy() mesh3:SetPosition(Vec3(1,0,0)) mesh4 = CreateCube() mesh4:SetParent(mesh3, 1) mesh4:SetPosition(Vec3(2,1,0),1) while KeyHit(KEY_ESCAPE)==0 do mesh1:Turn(Vec3(.5,0,0)) mesh3:Turn(Vec3(0,.5,0)) fw:Update() fw:Render() Flip(1) end Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Flexman Posted September 26, 2012 Posted September 26, 2012 I would suggest avoid parenting unless you have to. I have 3 kids now and they are quite demanding. In the past I've seen issues relating to scale (and rotation) when parenting one model to the child object of another. I will instead parent the model to another model's root or pivot, then translate the attached model to its final position/rotation (fine if the position is static). 4 Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo
Kronos Posted September 26, 2012 Author Posted September 26, 2012 Thanks for the input. I think I will take scaling out of the equation which will hopefully simplify things. Quote intel i5 2500k, ram 16gb, nvidia Geforce GTX570, asus xonar sound card. Windows 7 64 bit
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.