ModelrotatorVisual3D
#1
Hi,
I'm using a modelrotator with a standardTransform3D to rotate objects.
I follow the example ducks lake but i can't find where is defined the rotation center!!

Somebody can help me?
#2
StandardTransform3D always rotates around (0,0,0). 

This means that to rotate (and scale) your model correctly, the model (its mesh) needs to be defined in such a way that the center of the model (mesh) is at (0,0,0).


If you put a breakpoint to a line after the _duckModel3D is loaded and when the breakpoint is hit open the Immediate window. There write the following:

_duckModel3D.Dump()

and you will get the details about the model - for example (here is only the first part):

Code:
Bounds: X:       -0.16  Y:        0.00  Z:       -0.11
       SizeX:    0.32  SizeY:    0.30  SizeZ:    0.22
Center: X:        0.00  Y:        0.15  Z:        0.00


So the center of the duck is at (0, 0.15, 0) - ok when rotating around vertical axis (0,1,0).

Note that if you have a more complicated hierarchy of objects, you can also use _duckModel3D.DumpHierarchy()
Andrej Benedik
#3
(03-25-2020, 03:02 PM)abenedik Wrote: StandardTransform3D always rotates around (0,0,0). 

This means that to rotate (and scale) your model correctly, the model (its mesh) needs to be defined in such a way that the center of the model (mesh) is at (0,0,0).


If you put a breakpoint to a line after the _duckModel3D is loaded and when the breakpoint is hit open the Immediate window. There write the following:

_duckModel3D.Dump()

and you will get the details about the model - for example (here is only the first part):

Code:
Bounds: X:       -0.16  Y:        0.00  Z:       -0.11
       SizeX:    0.32  SizeY:    0.30  SizeZ:    0.22
Center: X:        0.00  Y:        0.15  Z:        0.00


So the center of the duck is at (0, 0.15, 0) - ok when rotating around vertical axis (0,1,0).

Note that if you have a more complicated hierarchy of objects, you can also use _duckModel3D.DumpHierarchy()

I'm not sure that i understand it correctly. But i don't need to rotate the obj using his center but i need to rotate it using a fixed point on the view. Is it possible?
Maybe using a RotateTransform3D?
#4
Thanks! Solved using RotateTransform3D
  


Forum Jump:


Users browsing this thread:
1 Guest(s)