探讨C/S架构下客户端使用UDP组播数据驱动三维场景框架结构的实现, 使客户端设计低耦合, 运行效率高.设计思路采用三维图形渲染引擎OSG, 在MFC平台上构建三维场景.针对三维数据的接收处理, 通过加入UDP组播组, 采用阻塞方式接收服务器端发来的网络数据, 将数据保存至缓存对象中, 然后调用缓存对象中的数据进行场景实时配置来驱动三维模型运动等操作, 实现三维场景实时变化更新.相对于没有加入数据缓存对象的设计模式, 此设计模式更加规范, 渲染效率得到提高, 并且在实际项目中也具有很强的应用价值.%In the paper, the implementation of client-driven 3 D scene framework using UDP multicast data under C/S architecture is discussed, which provides the client-side with low coupling and high operation efficiency in design.According to the design idea, 3 D graphics rendering engine OSG is adopted to build 3 D scenes on MFC platform. For receiving and processing three-dimensional data, the UDP multicast group is added, the network data sent from the server is received in a blocking way, the data is stored in the cache object, and then the data in the cache object is deployed to form a real-time con?guration of the scene to drive the movement of the 3 D model and other operations to realize real-time change and update of the three-dimensional scene. Compared with the design pattern without data cache objects, the design pattern is more standardized, the rendering ef?ciency is improved, and it also has a strong application value in actual projects.
展开▼