Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 5876d497 authored by Jund Thomas's avatar Jund Thomas
Browse files

import svg avec building

parent b80a842a
......@@ -36,6 +36,8 @@ EnvMap::EnvMap() :
position = map.addAttribute<VEC3, VERTEX>("position") ;
normal = map.addAttribute<VEC3, VERTEX>("normal") ;
positionScenary = mapScenary.addAttribute<VEC3, VERTEX>("position") ;
#ifndef SPATIAL_HASHING
agentvect = map.addAttribute<PFP::AGENTVECT, FACE>("agents") ;
neighborAgentvect = map.addAttribute<PFP::AGENTVECT, FACE>("neighborAgents") ;
......@@ -91,6 +93,19 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
// std::string filename = "./svg/simpleCross.svg" ;
Algo::Import::importSVG<PFP>(map, filename, position, obstacleMark, buildingMark) ;
std::cout << "test" << std::endl;
mapScenary.addAttribute<float, FACE>("agents") ;
std::string filename2 = "./svg/mapBuild.svg" ;
Algo::Import::importSVG<PFP>(mapScenary, filename2, positionScenary, obstacleMarkS, buildingMarkS) ;
// TraversorF<PFP::MAP> tF(mapScenary);
// for(Dart d = tF.begin() ; d != tF.end() ; d = tF.next())
// {
// CityGenerator::generateBuilding(mapScenary,d,5,1);
// }
// Algo::BooleanOperator::mergeVertices<PFP>(map, position) ;
// map.closeMap() ;
// Algo::Modelisation::CatmullClarkSubdivision<PFP>(map, position) ;
......
......@@ -413,9 +413,9 @@ void SocialAgents::cb_redraw()
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE) ;
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.map, Algo::Render::GL1::LINE, 1.0,
sim.envMap_.position, sim.envMap_.normal) ;
// Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.mapScenary, Algo::Render::GL1::LINE,
// 1.0, sim.envMap_.positionScenary,
// sim.envMap_.normalScenary) ;
Algo::Render::GL1::renderTriQuadPoly<PFP>(sim.envMap_.mapScenary, Algo::Render::GL1::LINE,
1.0, sim.envMap_.positionScenary,
sim.envMap_.normalScenary) ;
#endif
}
......@@ -1075,19 +1075,6 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
VEC3 col = Utils::color_map_BCGYR(float(i) / float(sim.agents_.size())) ;
out << "pigment { color <" << col[0] << "," << col[1] << "," << col[2] << "> }"
<< std::endl ;
// unsigned int col = (unsigned int)(float(i) / float(sim.agents_.size()) * 0xfffffe) ;
//
// std::cout << "i" << i << " truc " << xfloat(i) / float(sim.agents_.size())
// << std::endl ;
//
// std::cout << "col " << (col / 256 / 256) % 256 << "," << (col / 256) % 256 << ","
// << col % 256 << std::endl ;
//
// out << "pigment { color <" << (col > 16) / 256.0f << "," << ((col > 8) & 0xff) / 256.0f
// << "," << (col & 0xff) / 256.0f << "> }" << std::endl ;
// out << "pigment { color <" << (col / 256 / 256) % 256 << "," << (col / 256) % 256 << ","
// << col % 256 << "> }" << std::endl ;
}
else
{
......@@ -1126,11 +1113,11 @@ bool SocialAgents::exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std
VEC3 base(0, -1, 0) ;
VEC3 axisRot = base ^ dir ;
int sign = axisRot[2] > 0 ? 1 : -1 ;
//
// //57,2957795 : conversion from radian to degree
//57,2957795 : conversion from radian to degree
float myRot = acos(-dir[1]) * 57.2957795f ;
//
//
out << "rotate <0,0," << -90 + sign * myRot << ">" << std::endl ;
out << "rotate <" << angleX - 90 << "," << angleY << "," << angleZ << "> " << std::endl ;
// out << "translate <" << posR[0] << "," << posR[1] << "," << posR[2]+1+typeOfAgent*4*0.0638297872 << "> " << std::endl;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment