Jump to content

Global flag for ScaleEntity - LE2


Kronos
 Share

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.

intel i5 2500k, ram 16gb, nvidia Geforce GTX570, asus xonar sound card. Windows 7 64 bit

Link to comment
Share on other sites

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

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

  • 2 weeks later...

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

  • Upvote 4

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

Link to comment
Share on other sites

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.

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.

 Share

×
×
  • Create New...