Exemple #1
0
    Material::Material(const std::string& id) : Appearance( id, "Material" )
    {
        // Sets default values of the X3DMaterial definied in the citygml 1.0.0 spec see page 32 (section 9.3 Material)
        m_ambientIntensity =  0.2f;

        m_diffuse = TVec3f(0.8f, 0.8f, 0.8f);
        m_emissive = TVec3f(0.f, 0.f, 0.f);
        m_specular = TVec3f(1.f, 1.f, 1.f);

        m_shininess = 0.2f;
        m_transparency = 0.f;

        m_isSmooth = false;

    }
	void Polygon::finish( AppearanceManager& appearanceManager, bool doTesselate ) 
	{
		TVec3d normal = computeNormal();
		if ( doTesselate ) tesselate( appearanceManager, normal );	else mergeRings( appearanceManager );

		// Create the normal per point field
		_normals.resize( _vertices.size() );
		for ( unsigned int i = 0; i < _vertices.size(); i++ )
			_normals[i] = TVec3f( (float)normal.x, (float)normal.y, (float)normal.z );
	}