世界坐标系是系统的绝对坐标系,在没有建立用户坐标系之前,所有的坐标都是以该坐标的原点来确定各自的位置的。
OSG中的坐标系是X正向向右,Y轴正向向里,Z轴正向向上
OpenGL的坐标系是X正向向右,Y轴正向向上,Z轴正向向外
// osgStudy4_21(1).cpp : 定义控制台应用程序的入口点。
//使用空间变换节点//1、根据用户视点自动进行变换的AutoTransform节点
//2、直接使用变换矩阵进行变换的MatrixTransform节点
//3、使用位移、旋转和缩放值进行变换的PositionAttitudeTransform节点。
#include "stdafx.h"
#include<osg/AutoTransform>
#include<osg/MatrixTransform>
#include<osg/PositionAttitudeTransform>
#include<osgDB/ReadFile>
#include<osgViewer/Viewer>
//创建自动变换节点对象,使其始终面对屏幕,用户视点。
//第一个参数是沿X轴方向的平移距离,第二个参数是要变换的模型
//Transform公有继承Group类,AutoTransform公有继承Transform
osg::Transform* createAutoTransform(double posX, osg::Node* model){
<span style="white-space:pre"> </span>osg::ref_ptr<osg::AutoTransform> at = new osg::AutoTransfo