Skip to content
cinder block for creating and using cubemaps
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
include/ciCubeMap
proj/cmake
samples
src/ciCubeMap
.gitignore
README.md
cinderblock.xml

README.md

ciCubeMap

A cinder block that provides an high-level API for creating and using cubemap (as well as equirectangular) content in various formats.

Credits

Most, or at least the initial, logic in this block is based on the DynamicCubeMapping sample application in the cinder repository.

Usage

See the example applications in the samples folder, but this is what it more or less looks like;

#include "ciCubeMap/ciCubeMap.h"

cinder::CubeMap::MapperRef mapperRef;

void CinderApp::setup(){
  // create a cubemapper with an FboCubeMap with faces of 1024x1024 pixels
  mapperRef = cinder::CubeMap::Mapper::create(1024, 1024);
}

void CinderApp::update(){
  // update -render to- the mapper's fbo
  mapperRef->update([this](){
    // call this->drawScene() or something here...
  });
}

void CinderApp::draw(){
  // draw equirectangular representation of cubemap
  gl::drawEquirectangular(mapperRef->getFboCubeMap()->getTextureCubeMap(), Rectf(0,0,400,200));

  // draw cross representation of cubemap
  gl::drawHorizontalCross(mapperRef->getFboCubeMap()->getTextureCubeMap(), Rectf(0,200,400,500));
}

equirectangular horizontalcross

You can’t perform that action at this time.