|
|
It is really thank you for your answer and give me the right script.
I find that: If establishing the relation between groups and models at the
very first, we will get the result expected. But if we attach a model or a
group to a transformed group, there will be an unexpected result. For exanple,
I attatch a model to a transformed group. then I set the model's transformation:
position: vector(0.0,0.0,0.0)
rotation: vector(0.0,0.0,0.0)
scale: (1.0,1.0,1.0)
The tansform of the model and group are not same. The result of the code
attachand is:
-- vector( 0.0000, 0.0000, 0.0000 )
-- vector( 1.6521, 1.0000, 1.2106 )
-- vector( 0.0000, 68.1986, 0.0000 )
the model's world transform is strange and not easy to explain.
So I wander how director works when attatch a model or group to a transformed
group. I hope somebody can give me a explaination in mathematics.
on beginSprite
clearglobals()
_movie.member(2).resetWorld()
Group1=_movie.member(2).newgroup("group1")
Group1.transform.rotation=vector(0.0,45.0,0.0)
Group1.transform.scale=vector(2.0,1.0,1.0)
Group1.transform.position=vector(0.0,0.0,0.0)
pModel=_movie.member(2).newModel("model1")
Group1.addChild(pModel,#preserveWorld)
pModel.transform.position=vector(0.0,0.0,0.0)
pModel.transform.rotation=vector(0.0,0.0,0.0)
pModel.transform.scale=vector(1.0,1.0,1.0)
put pModel.getworldtransform().position
put pModel.getworldtransform().scale
put pModel.getworldtransform().rotation
end
|
|