3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
Logo3D.cpp

This example generates the surface consist of logo 3D picture

// This example generates the surface consist of logo 3D picture
#include <CoreAPI.h>
using namespace coat;
EXPORT
int main() {
// create new volume, don't need to set density as in voxels
auto scene = Scene::sculptRoot().addChild("Logo3D");
// get the volume object to refer later
auto volume = scene.Volume();
// turn to surface mode
volume.toSurface();
// get the file name of the top texture and top bump texture
str installPath = io::installPath();
str file = installPath + "/UserPrefs/CoreAPI/.coredox/images/logo_400x400.png";
// add the image primitive with basic and bump thickness equals 10, primitive width = 256 and primitive depth = 16
image().topTexture(file)
.width(256)
.depth(16)
.add(volume);
return 0;
}
The class allows to operate over voxels/surface on the relatively low-level.
Definition CoreAPI.h:1940
void toSurface()
turn to surface mode, the triangles will be tangentially relaxed
image primitive
Definition CorePrimAPI.h:1926
image & topTexture(const char *_texture)
set the top texture
image & topBumpTexture(const char *_texture)
set the top bump texture
image & bumpThickness(const float &_thickness)
set the bump thickness of image
image & basicThickness(const float &_thickness)
set the basic thickness of image
void add(Volume &v)
add the prim into scene
text & depth(const float &d)
set the text depth in the pixels
text & width(const float &w)
set the text width in the pixels
The coat namespace used for most 3DCoat API calls except low-level internal structures.
Definition CoreAPI.h:43
comms::cStr str
the string that is compatible with the 3DCoat engine, see the cStr
Definition CoreAPI.h:67