Hi, i am working on a biological project with a doctor, and i am trying to import some 3D (obj) in a class.
It’s working perfectly, but the problem il the position of them. They are going around, like… I do not know, but they are not in the good position (and maybe scale… but first i want to know about the coordinates).
Do you know if i forget something, really, i do not know what to do??
Here is what it have to look like, without colors (i import every part of it in C4D, and i tried in Rhino3D, so the corrdinates are working):
Here is what it looks like when i build&run the program (Really, WTF??):
here is my code (.cpp):
//
// Bassin3D.cpp
//
//
// Created by Vincent Marsat on 25/05/16.
//
//
#include "Bassin3D.h"
Bassin3D::Bassin3D(){
ofEnableSeparateSpecularLight();
Deferent3D.loadModel("3D/deferent.obj", false);
foie3D.loadModel("3D/foie.obj", false);
rate3D.loadModel("3D/Rate.obj", false);
rectum3D.loadModel("3D/rectum.obj", false);
ReinD3D.loadModel("3D/ReinD.obj", false);
ReinG3D.loadModel("3D/ReinG.obj", false);
ureteres3D.loadModel("3D/ureteres.obj", false);
ureterefin3D.loadModel("3D/ureteresfin.obj", false);
VCI3D.loadModel("3D/VCI.obj", false);
AMS3D.loadModel("3D/AMS.obj", false);
Aorte3D.loadModel("3D/Aorte.obj", false);
BassinA3D.loadModel("3D/sacrum.obj", false);
Colonne3D.loadModel("3D/Colonne.obj", false);
osBassinD3D.loadModel("3D/ilionD.obj", false);
osBassinG3D.loadModel("3D/ilionG.obj", false);
osCotes3D.loadModel("3D/Cotes.obj", false);
femurG3D.loadModel("3D/femurD.obj", false);
femurD3D.loadModel("3D/femurG.obj", false);
oi3D.loadModel("3D/oi.obj", false);
image.loadImage(text);
center = ofPoint(0,0,0);
}
void Bassin3D::Mode(int mode,int x,int y,int z){
// LX = x;
// LY = y;
// LZ = z;
}
void Bassin3D::Colonne(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofTranslate(Colonne3D.getSceneCenter());
ofMesh mesh;
mesh = Colonne3D.getCurrentAnimatedMesh(0);
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
//ofMultMatrix(Colonne3D.getModelMatrix());
ofSetColor(255, 0, 0);
mesh.drawFaces();
text = "text.png";
image.draw(mesh.getCentroid(), 20, 20);
} else {
}
}
switch(mode){
case 1:
ofMultMatrix(Colonne3D.getModelMatrix());
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
Colonne3D.drawVertices();
break;
case 3:
Colonne3D.clear();
break;
default:
Colonne3D.drawFaces();
break;
}
ofPopMatrix();
ofPopStyle();
}
void Bassin3D::Deferent(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = Deferent3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX2 = "<< LX << endl;
cout << "XCmin2 = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
text = "text.png";
image.draw(mesh.getCentroid(), 20, 20);
} else {
}
}
switch(mode){
case 1:
ofMultMatrix(Deferent3D.getModelMatrix());
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
Deferent3D.drawVertices();
break;
case 3:
Deferent3D.clear();
break;
default:
Deferent3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::foie(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
ofTranslate(Colonne3D.getSceneCenter());
mesh = foie3D.getCurrentAnimatedMesh(0);
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX3 = "<< LX << endl;
cout << "XCmin3 = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
foie3D.drawVertices();
break;
case 3:
foie3D.clear();
break;
default:
foie3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::oi(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = oi3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
oi3D.drawVertices();
break;
case 3:
oi3D.clear();
break;
default:
oi3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::rate(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = rate3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
rate3D.drawVertices();
break;
case 3:
rate3D.clear();
break;
default:
rate3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::rectum(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = rectum3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
rectum3D.drawVertices();
break;
case 3:
rectum3D.clear();
break;
default:
rectum3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::VCI(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = VCI3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
VCI3D.drawVertices();
break;
case 3:
VCI3D.clear();
break;
default:
VCI3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
/////////////////////////////////////////
void Bassin3D::AMS(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = AMS3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
AMS3D.drawVertices();
break;
case 3:
AMS3D.clear();
break;
default:
AMS3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::Aorte(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = Aorte3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
Aorte3D.drawVertices();
break;
case 3:
Aorte3D.clear();
break;
default:
Aorte3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::ReinD(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = Colonne3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
ReinD3D.drawVertices();
break;
case 3:
ReinD3D.clear();
break;
default:
ReinD3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::ReinG(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = ReinG3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
ReinG3D.drawVertices();
break;
case 3:
ReinG3D.clear();
break;
default:
ReinG3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::uretere(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = ureteres3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
ureteres3D.drawVertices();
break;
case 3:
ureteres3D.clear();
break;
default:
ureteres3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::ureterefin(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = ureterefin3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
ureterefin3D.drawVertices();
break;
case 3:
ureterefin3D.clear();
break;
default:
ureterefin3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
/////////////////////////////////
void Bassin3D::BassinA(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = BassinA3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
BassinA3D.drawVertices();
break;
case 3:
BassinA3D.clear();
break;
default:
BassinA3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::osBassinD(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = osBassinD3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
osBassinD3D.drawVertices();
break;
case 3:
osBassinD3D.clear();
break;
default:
osBassinD3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::osBassinG(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
mesh = osBassinG3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
osBassinG3D.drawVertices();
break;
case 3:
osBassinG3D.clear();
break;
default:
osBassinG3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::osCotes(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
//mesh = osCotes3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
osCotes3D.drawVertices();
break;
case 3:
osCotes3D.clear();
break;
default:
osCotes3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::femurG(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
//mesh = femurG3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "LX = "<< LX << endl;
cout << "XCmin = "<< XCmin << endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
femurG3D.drawVertices();
break;
case 3:
femurG3D.clear();
break;
default:
femurG3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}
void Bassin3D::femurD(int mode){
ofPushStyle();
ofPushMatrix();
ofEnableDepthTest();
ofMesh mesh;
//mesh = femurD3D.getCurrentAnimatedMesh(0);
ofTranslate(Colonne3D.getSceneCenter());
float XCmin = mesh.getCentroid().x - (0.51);
float XCmax = mesh.getCentroid().x + (0.51);
float YCmin = mesh.getCentroid().y - (0.51);
float YCmax = mesh.getCentroid().y + (0.51);
float ZCmin = mesh.getCentroid().z - (0.51);
float ZCmax = mesh.getCentroid().z + (0.51);
cout << "fin processus 3D"<< endl;
if (LX > XCmin && LX < XCmax && LY > YCmin&& LY < YCmax && LZ > ZCmin && LZ < ZCmax) {
if(mode < 3){
ofSetColor(255, 0, 0);
mesh.drawFaces();
ofDrawBitmapString("_______Colonne", mesh.getCentroid());
} else {
}
}
switch(mode){
case 1:
ofSetColor(255, 255, 255);
mesh.drawFaces();
break;
case 2:
Colonne3D.drawVertices();
break;
case 3:
Colonne3D.clear();
break;
default:
Colonne3D.drawFaces();
break;
}
ofPopStyle();
ofPopMatrix();
}