update matrix setting and move lookat function