Jump to content

Search the Community

Showing results for tags 'indices'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. Hello together, I try to change the indices of an ObjectDynamic during runtime to discard some points in Unigine 2.11. I can call clearIndices() on this object and all geometry vanish. But when I change the index array and set it again. the changed data won't get uploaded and the geometry still looks the same. Any ideas? int AppWorldLogic::init() { // Write here code to be called on world initialization: initialize resources for your world scene during the world start. m_dynamicObject = Unigine::ObjectDynamic::create(); m_dynamicObject->setMaterialNodeType(Unigine::Node::TYPE::OBJECT_MESH_STATIC); m_dynamicObject->setWorldTransform(Unigine::Math::translate(Unigine::Math::Vec3(0.0, -4.0, 1.0))); m_dynamicObject->setMaterial("custom_forward_material","*"); const Unigine::ObjectDynamic::Attribute attributes[]={{ 0, Unigine::ObjectDynamic::TYPE_FLOAT, 3 }}; m_dynamicObject->setVertexFormat(attributes, 1); m_dynamicObject->setSurfaceMode(Unigine::ObjectDynamic::MODE::MODE_POINTS, 0); m_dynamicObject->setBoundBox(Unigine::BoundBox(Unigine::Math::vec3(-10000.f, -10000.f, -10000.f), Unigine::Math::vec3(10000.f, 10000.f, 10000.f))); Unigine::Math::vec3 position; for (int i = 0; i < 1000; ++i) { for (int j = 0; j < 100; ++j) { position = Unigine::Math::vec3(i, j, 1.f); m_dynamicObject->addVertexFloat(0, position, 3); } } m_indices = new int[100000]; for (int index = 0; index < 100000; ++index) { m_indices[index] = index; } m_dynamicObject->setIndicesArray(m_indices, 100000); return 1; } //////////////////////////////////////////////////////////////////////////////// // start of the main loop //////////////////////////////////////////////////////////////////////////////// int AppWorldLogic::update() { static int counter=1; if (counter % 120 == 0) { m_dynamicObject->clearIndices(); } else if(counter % 120 == 60) { for (int i = 0; i < 100000; ++i) { m_indices[i] = (rand() % 2 == 1) ? i : 0; } m_dynamicObject->setIndicesArray(m_indices, 100000); } counter++; return 1; }
×
×
  • Create New...