finished the code writing mesh, and fixed the object offset calculation.