Hi all,
I’m noticing that whenever I change the rotation of a model and then ask for its scale relative to another model that has a certain transform set to it, I get different values, even though I didn’t explicitly change the scale of the first model. Here is some simple sample code that shows the issue:
smi=loader.loadModel("smiley.egg")
smi.reparentTo(render)
smi.setPos(-115.475,119.567,-42.1858)
smi.setScale(2.7072,2.7072,1.6649)
boxModel=loader.loadModel("box.egg")
boxModel.reparentTo(render)
boxModel.setZ(boxModel,-2)
boxModel.setHpr(34,56,78)
boxModel.setScale(0.6)
print(boxModel.getScale(smi),boxModel.getScale(render))
boxModel.setR(boxModel,13)
boxModel.setP(boxModel,33)
#boxModel.setH(boxModel,73)
print(boxModel.getScale(smi),boxModel.getScale(render))
The first print output is this:
LVecBase3f(0.245893, 0.323455, 0.222569) LVecBase3f(0.6, 0.6, 0.6)
While the second is this:
LVecBase3f(0.251558, 0.295914, 0.237806) LVecBase3f(0.6, 0.6, 0.6)
As you can see, there are differences in the relative scale value, even though I didn’t explicitly change the scale of the box-model at all. Is this just something to be expected, or is there a way to ensure there are no strange changes in scale and position, whenever the rotation is modified and a query is made relative to another model?
(This is important in my case, since the obtained values will be written out to an animation file and obviously if this persists, there will be undesired visible differences).
Any help is appreciated, thanks in advance.