Click here to Skip to main content
16,005,236 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Stephen Hewitt20-Mar-06 11:44
Stephen Hewitt20-Mar-06 11:44 
QuestionBit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 5:06
Iain Clarke, Warrior Programmer20-Mar-06 5:06 
AnswerRe: Bit Fields, and sub field size. Pin
Bob Flynn20-Mar-06 8:21
Bob Flynn20-Mar-06 8:21 
GeneralRe: Bit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 21:40
Iain Clarke, Warrior Programmer20-Mar-06 21:40 
GeneralRe: Bit Fields, and sub field size. Pin
Bob Flynn21-Mar-06 3:05
Bob Flynn21-Mar-06 3:05 
Questionassertion errors Pin
theprinc20-Mar-06 4:52
theprinc20-Mar-06 4:52 
AnswerRe: assertion errors Pin
PJ Arends20-Mar-06 5:05
professionalPJ Arends20-Mar-06 5:05 
GeneralRe: assertion errors Pin
theprinc20-Mar-06 5:22
theprinc20-Mar-06 5:22 
The code which pushes the vector
bobject o=read_Obj(argv[i]);
o.active=1; //Active
o.picked=0;//Not picked
o.path=argv[i]; //save object path
---------------->store_normal(o);
glLoadIdentity ();
glGetFloatv(GL_MODELVIEW_MATRIX,o.m);
//initialize all variables
cout<<"in"<<endl;
----------------->ob.MyObjects.push_back(o);

the store_normal code is
void store_normal(bobject o)
{
for(int i =0;i<o.faces.size();i++)
{
//caculate the normal of the vertices
GLfloat x;
GLfloat y;
GLfloat z;

//vertex1 - vertex2
float a1= o.faces[i].second.x- o.faces[i].first.x;
float a2= o.faces[i].second.y- o.faces[i].first.y;
float a3= o.faces[i].second.z- o.faces[i].first.z;

//vertex2 - vertex3
float b1= o.faces[i].third.x-o.faces[i].first.x;
float b2= o.faces[i].third.y-o.faces[i].first.y;
float b3= o.faces[i].third.z-o.faces[i].first.z;

//calculate x y,and z cordinates for normal using cross product
x=(a3*b2)-(a2*b3);
y=(a1*b3)-(a3*b1);
z=(a2*b1)-(a1*b2);

//1st normal

o.vert[o.faces[i].v1].norm.x =o.vert[o.faces[i].v1].norm.x+x;
o.vert[o.faces[i].v1].norm.y =o.vert[o.faces[i].v1].norm.y+y;
o.vert[o.faces[i].v1].norm.z =o.vert[o.faces[i].v1].norm.z+z;


//2nd normal
o.vert[o.faces[i].v2].norm.x =o.vert[o.faces[i].v2].norm.x+x;
o.vert[o.faces[i].v2].norm.y =o.vert[o.faces[i].v2].norm.y+y;
o.vert[o.faces[i].v2].norm.z =o.vert[o.faces[i].v2].norm.z+z;


//3rd normal
o.vert[o.faces[i].v3].norm.x =o.vert[o.faces[i].v3].norm.x+x;
o.vert[o.faces[i].v3].norm.y =o.vert[o.faces[i].v3].norm.y+y;
o.vert[o.faces[i].v3].norm.z =o.vert[o.faces[i].v3].norm.z+z;
}
}


this assertion error occurs when i include store_normal(o);
GeneralRe: assertion errors Pin
PJ Arends21-Mar-06 15:56
professionalPJ Arends21-Mar-06 15:56 
Questionin/out in visual c++ Pin
a_yosef20-Mar-06 4:45
a_yosef20-Mar-06 4:45 
AnswerRe: in/out in visual c++ Pin
PJ Arends20-Mar-06 5:10
professionalPJ Arends20-Mar-06 5:10 
Questionmade by Borland Pin
militiaware20-Mar-06 4:30
militiaware20-Mar-06 4:30 
AnswerRe: made by Borland Pin
toxcct20-Mar-06 4:45
toxcct20-Mar-06 4:45 
QuestionCall another exe Programatically Pin
HNGuruPrasad20-Mar-06 4:28
HNGuruPrasad20-Mar-06 4:28 
AnswerRe: Call another exe Programatically Pin
Michael Dunn20-Mar-06 8:01
sitebuilderMichael Dunn20-Mar-06 8:01 
Questionostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider20-Mar-06 4:07
Sebastian Schneider20-Mar-06 4:07 
AnswerRe: ostringstream: special characters &quot;/&quot; or &quot;?&quot; ? Pin
PJ Arends20-Mar-06 4:44
professionalPJ Arends20-Mar-06 4:44 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
toxcct20-Mar-06 4:47
toxcct20-Mar-06 4:47 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
PJ Arends20-Mar-06 4:54
professionalPJ Arends20-Mar-06 4:54 
GeneralRe: ostringstream: special characters "/" or "?" ? Pin
Sebastian Schneider21-Mar-06 0:35
Sebastian Schneider21-Mar-06 0:35 
QuestionInstantiating classes within classes Pin
kialmur20-Mar-06 4:02
kialmur20-Mar-06 4:02 
AnswerRe: Instantiating classes within classes Pin
Maximilien20-Mar-06 4:23
Maximilien20-Mar-06 4:23 
AnswerRe: Instantiating classes within classes Pin
oshah20-Mar-06 4:24
oshah20-Mar-06 4:24 
GeneralRe: Instantiating classes within classes Pin
kialmur20-Mar-06 4:34
kialmur20-Mar-06 4:34 
GeneralRe: Instantiating classes within classes Pin
toxcct20-Mar-06 4:49
toxcct20-Mar-06 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.