snap to grid, AxisTranslationTool

Have jReality programming problems or questions? Post them here.
Post Reply
pederico
Posts: 5
Joined: Wed 2. Apr 2014, 22:55

snap to grid, AxisTranslationTool

Post by pederico » Sat 5. Apr 2014, 15:53

Hello,

I have another question/request. Can somebody help me build a small example on how to use the AxisTranslationTool? I have looked inside the ContentTool class to see how to use it, but until now, I can not say that I was succesful. I need to be able to move objects only on integer 3d coordinates. Your help would be greatly appreciated.

Andre
Posts: 226
Joined: Fri 18. Sep 2009, 11:30

Re: snap to grid, AxisTranslationTool

Post by Andre » Wed 23. Apr 2014, 11:12

Do you want to translate to your own grid or to jReality default?

If you want to translate to jReality-default-axis (x/y/z direction) simply apply this Translation

Code: Select all

MatrixBuilder.euclidean().translate(dx, dy, dz).assignTo(YOUR_SCENEGRAPHCOMPONENT);
dx, dy, dz is the change in each direction you want do. You can simply attach this to your tool.

Post Reply