Jump to content
Kronos

Global flag for ScaleEntity - LE2

Recommended Posts

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.

Share this post


Link to post

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

Share this post


Link to post

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).

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...