fixed 3d bugs, and fixed offset
Merge remote-tracking branch 'origin/master'