c++: generate the same scene as the ref go version