首先这个在android上是支持的
其次,想用文件名加坐标加trans,是不行的,会提示动态链接缺少,osgdb方面的
所以只有用变换节点来实现
以下是小米手机,400个3m的模型,压力不大,纹理没渲染出来,如果纹理渲染出来了,应该开始卡了。
奉献一个代码
#pragma once
//Standard libraries
#include "JNIUtils.h"
#include <string>
#include <sstream>
#include <osg/Vec3>
#include <osg/Node>
#include <osg/Group>
#include <osg/MatrixTransform>
#include <osg/PagedLOD>
#include <osgDB/ReadFile>
struct PageLODFileRang
{
std::string fileName;
float minDistance;
float maxDistance;
public :
PageLODFileRang(const std::string& file,const float& min,const float& max)
{
fileName = file;
minDistance = min;
maxDistance = max;
}
};
class XPageLODGroup:
public osg::Group
{
private:
std::vector <PageLODFileRang> m_pageLODFileData;
std::vector<osg::Vec3> m_positionList;
public:
XPageLODGroup();
XPageLODGroup( const std::vector<PageLODFileRang>& pageLODFileData, const std::vector<osg::Vec3>& positionList);
~XPageLODGroup(voi