Now I am just trying to get a basic example set up, following the code from
https://bitbucket.org/volumesoffun/polyvox/wiki/Building%20PolyVox%20with%20CodeBlocks%20MinGW%20and%20Ogre3D here. I am using Ogre3d.
Here is the code:
Code:
SimpleVolume<uint8_t> volData(PolyVox::Region(Vector3DInt32(0, 0, 0), Vector3DInt32(63, 63, 63)));
createSphereInVolume(volData, 30);
SurfaceMesh<PositionMaterialNormal> mesh;
//MarchingCubesSurfaceExtractor< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
CubicSurfaceExtractorWithNormals< SimpleVolume<uint8_t> > surfaceExtractor(&volData, volData.getEnclosingRegion(), &mesh);
surfaceExtractor.execute();
cerr << mesh.getNoOfIndices() << ' ' << mesh.getNoOfVertices() << endl;
// Set the scene's ambient light
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5f, 0.5f, 0.5f));
//Create a ManualObject
Ogre::ManualObject* manual = mSceneMgr->createManualObject("manual");
//Begin a section of the ManualObject (we're only using one section)
manual->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_TRIANGLE_LIST);
//Iterate through all the vertices in the mesh produced by the surface extractor
//and add them to the ManualObject section.
for(vector<PositionMaterialNormal>::const_iterator it = mesh.getVertices().begin(); it != mesh.getVertices().end(); ++it)
{
const Vector3DFloat& vertexPos = it->getPosition();
const Vector3DFloat& vertexNorm = it->getNormal();
manual->position(vertexPos.getX(),vertexPos.getY(),vertexPos.getZ());
manual->normal(vertexNorm.getX(),vertexNorm.getY(),vertexNorm.getZ());
manual->colour(abs(vertexNorm.getX()),abs(vertexNorm.getY()),abs(vertexNorm.getZ()));
}
//Now we iterate through all the indices from the mesh and also add them to the ManualObject section
for(vector<uint32_t>::const_iterator it = mesh.getIndices().begin(); it != mesh.getIndices().end(); ++it)
{
manual->index(*it);
}
//End the section then add the ManualObject to the scenegraph
manual->end();
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual);
// Create a Light and set its position
Ogre::Light* light = mSceneMgr->createLight("MainLight");
light->setPosition(20.0f, 80.0f, 50.0f);
and here are the error messages I get:
Code:
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(193): error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_const_iterator<_Myvec>'
1> with
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,std::allocator<PolyVox::PositionMaterialNormal>>
1> ]
1> and
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(193): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Myvec>' (or there is no acceptable conversion)
1> with
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(425): could be 'bool std::operator !=(const std::error_code &,const std::error_condition &)' [found using argument-dependent lookup]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(432): or 'bool std::operator !=(const std::error_condition &,const std::error_code &)' [found using argument-dependent lookup]
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(335): or 'bool Ogre::operator !=(const Ogre::UTFString::_const_fwd_iterator &,const Ogre::UTFString::_const_fwd_iterator &)'
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(422): or 'bool Ogre::operator !=(const Ogre::UTFString::_const_rev_iterator &,const Ogre::UTFString::_const_rev_iterator &)'
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreshadowtexturemanager.h(68): or 'bool Ogre::operator !=(const Ogre::ShadowTextureConfig &,const Ogre::ShadowTextureConfig &)'
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\guiddef.h(197): or 'int operator !=(const GUID &,const GUID &)'
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\propkeydef.h(33): or 'int operator !=(const PROPERTYKEY &,const PROPERTYKEY &)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(206): or 'bool std::_Vector_const_iterator<_Myvec>::operator !=(const std::_Vector_const_iterator<_Myvec> &) const'
1> with
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1> ]
1> while trying to match the argument list '(std::_Vector_const_iterator<_Myvec>, std::_Vector_const_iterator<_Myvec>)'
1> with
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,Ogre::STLAllocator<PolyVox::PositionMaterialNormal,Ogre::GeneralAllocPolicy>>
1> ]
1> and
1> [
1> _Myvec=std::_Vector_val<PolyVox::PositionMaterialNormal,std::allocator<PolyVox::PositionMaterialNormal>>
1> ]
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(203): error C2440: 'initializing' : cannot convert from 'std::_Vector_const_iterator<_Myvec>' to 'std::_Vector_const_iterator<_Myvec>'
1> with
1> [
1> _Myvec=std::_Vector_val<uint32_t,std::allocator<char32_t>>
1> ]
1> and
1> [
1> _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\blake\basics\finite\projects\development\client\finite\finite\gamestate.cpp(203): error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::_Vector_const_iterator<_Myvec>' (or there is no acceptable conversion)
1> with
1> [
1> _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(425): could be 'bool std::operator !=(const std::error_code &,const std::error_condition &)' [found using argument-dependent lookup]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error(432): or 'bool std::operator !=(const std::error_condition &,const std::error_code &)' [found using argument-dependent lookup]
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(335): or 'bool Ogre::operator !=(const Ogre::UTFString::_const_fwd_iterator &,const Ogre::UTFString::_const_fwd_iterator &)'
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreutfstring.h(422): or 'bool Ogre::operator !=(const Ogre::UTFString::_const_rev_iterator &,const Ogre::UTFString::_const_rev_iterator &)'
1> c:\users\blake\basics\finite\libraries\ogresdk_vc10_v1-8-0\include\ogre\ogreshadowtexturemanager.h(68): or 'bool Ogre::operator !=(const Ogre::ShadowTextureConfig &,const Ogre::ShadowTextureConfig &)'
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\guiddef.h(197): or 'int operator !=(const GUID &,const GUID &)'
1> c:\program files (x86)\microsoft sdks\windows\v7.0a\include\propkeydef.h(33): or 'int operator !=(const PROPERTYKEY &,const PROPERTYKEY &)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(206): or 'bool std::_Vector_const_iterator<_Myvec>::operator !=(const std::_Vector_const_iterator<_Myvec> &) const'
1> with
1> [
1> _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1> ]
1> while trying to match the argument list '(std::_Vector_const_iterator<_Myvec>, std::_Vector_const_iterator<_Myvec>)'
1> with
1> [
1> _Myvec=std::_Vector_val<size_t,Ogre::STLAllocator<size_t,Ogre::GeneralAllocPolicy>>
1> ]
1> and
1> [
1> _Myvec=std::_Vector_val<uint32_t,std::allocator<char32_t>>
1> ]
Any ideas?