Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to set the "Dialog Focus" in Dialog Based Application Pin
suiram4028-Nov-03 11:17
suiram4028-Nov-03 11:17 
AnswerRe: How to set the "Dialog Focus" in Dialog Based Application Pin
l a u r e n29-Nov-03 13:39
l a u r e n29-Nov-03 13:39 
QuestionHow to identify a computer in a LAN from the internet? Pin
ray_li28-Nov-03 9:50
ray_li28-Nov-03 9:50 
AnswerRe: How to identify a computer in a LAN from the internet? Pin
suiram4028-Nov-03 11:13
suiram4028-Nov-03 11:13 
QuestionSpinBottonCtrl Limit? Pin
sdfdsfa28-Nov-03 9:24
sdfdsfa28-Nov-03 9:24 
AnswerRe: SpinBottonCtrl Limit? Pin
suiram4028-Nov-03 11:16
suiram4028-Nov-03 11:16 
Generalreading file properties. Pin
pnpfriend28-Nov-03 9:03
pnpfriend28-Nov-03 9:03 
GeneralStack Overflow Q Pin
suiram4028-Nov-03 9:02
suiram4028-Nov-03 9:02 
I'm adding to this editor (http://marius.homeunix.org:8000)
Sphere template brush.
The sphere of course has more polygons than any other primitive there.
So If I create a sphere with 32 bands and 32 sections I get 1K polygons. Sphere is a solid so all its facea are facing out, so the BSP will be a straight line having on left 1024 nodes and each of it
on right s empty node containing one polygon.

o
/
/\1
/\1
/\1
...
/
x






By building a BSP out of this (preparation for CSG)
I get Stack Overflow. I tried to reduce the stack storage
to minimum So I reduced it from 1040 bytes to 600 bytes.
The number of recurvie calls has increased a bit but I still get
the stack overflow.
Have you any ideea of unroling the BSP compilatin ptrocess.
Thx

void MiniBsp::R_Compile(int nodeIdx, dynaArray<poly>& polys)
{

dynaArray<poly> frontPolys;
dynaArray<poly> backPolys;
CMiniNode* pNode = _nodesPtr[nodeIdx];
pNode->_planeIdx = GetBestSplitter(polys, 0);

int splitters = polys.size();
while(polys.size())
{
Poly& curPoly = polys.back();
if(curPoly.IsSplitter())
splitters--;
REL_POS whereIs = curPoly.Classify(pNode->GetPlane());
switch(whereIs)
{
case ON_PLANE:
if(ISZERO(VDp(curPoly._normal, pNode->GetPlane()._normal)-1.f))
frontPolys.push_back(curPoly);
else
backPolys.push_back(curPoly);
break;
case ON_FRONT:
frontPolys.push_back(curPoly);
break;
case ON_BACK:
backPolys.push_back(curPoly);
break;
case ON_SPLIT:
{
Poly frontPoly;
Poly backPoly;
curPoly.Split(pNode->GetPlane(), frontPoly, backPoly);
backPolys.push_back(backPoly);
frontPolys.push_back(frontPoly);
}
break;
default:
break;
}
polys.pop_back();
}

if(frontPolys.size())
{
if(splitters == ) // MAKE A LEAF
{
CMiniNode* fn = CreateNode(NODE_LEAF);
pNode->_nodeidx[N_FRONT] = _nodesPtr.size();
fn->_polyIdx = _polys.size();
fn->_nPolys = frontPolys.size();
AddNode(fn);
colex::append(_polys, frontPolys);
UpdateNodeBB(fn, frontPolys);
frontPolys.clear();
}
else // continue
{
CMiniNode* fn = CreateNode(0);
pNode->_nodeidx[N_FRONT]=_nodesPtr.size();
fn->_idxParent = pNode->_idxNodeThis;
AddNode(fn);
R_Compile(pNode->_nodeidx[N_FRONT], frontPolys);
}
}
if(backPolys.size()) // MAKE A SOLID LEAF
{
CMiniNode* bn = CreateNode(0);
pNode->_nodeidx[N_BACK] = _nodesPtr.size();
bn->_idxParent = pNode->_idxNodeThis;
AddNode(bn);
R_Compile(pNode->_nodeidx[N_BACK], backPolys);
}
else // continue
{
CMiniNode* bn = CreateNode(NODE_LEAF|NODE_SOLID);
pNode->_nodeidx[N_BACK]=_nodesPtr.size();
bn->_idxParent = pNode->_idxNodeThis;
AddNode(bn);
}
}
GeneralRe: Stack Overflow Q Pin
igor196028-Nov-03 10:41
igor196028-Nov-03 10:41 
GeneralRe: Stack Overflow Q Pin
suiram4028-Nov-03 11:05
suiram4028-Nov-03 11:05 
GeneralRe: Stack Overflow Q Pin
igor196028-Nov-03 11:58
igor196028-Nov-03 11:58 
QuestionStreet address parsing? Pin
Ed K28-Nov-03 8:28
Ed K28-Nov-03 8:28 
AnswerRe: Street address parsing? Pin
JWood28-Nov-03 10:18
JWood28-Nov-03 10:18 
GeneralRe: Street address parsing? Pin
User 58385230-Nov-03 17:06
User 58385230-Nov-03 17:06 
AnswerRe: Street address parsing? Pin
jhwurmbach30-Nov-03 21:39
jhwurmbach30-Nov-03 21:39 
Generalopening file !!help me Pin
mitil2039048230428-Nov-03 7:53
mitil2039048230428-Nov-03 7:53 
GeneralRe: opening file !!help me Pin
vancouver77728-Nov-03 9:08
vancouver77728-Nov-03 9:08 
GeneralRe: opening file !!help me Pin
mitil2039048230428-Nov-03 9:12
mitil2039048230428-Nov-03 9:12 
GeneralRe: opening file !!help me Pin
hyph3n28-Nov-03 14:57
hyph3n28-Nov-03 14:57 
GeneralHelp ME PLEASEEEE!! Simple QUESTION! Pin
Anonymous28-Nov-03 7:39
Anonymous28-Nov-03 7:39 
GeneralRe: Help ME PLEASEEEE!! Simple QUESTION! Pin
(Steven Hicks)n+129-Nov-03 7:37
(Steven Hicks)n+129-Nov-03 7:37 
GeneralCDataGrid with Another Language Pin
sdfdsfa28-Nov-03 6:50
sdfdsfa28-Nov-03 6:50 
Generalfinal Class Pin
Anonymous28-Nov-03 5:43
Anonymous28-Nov-03 5:43 
GeneralRe: final Class Pin
Roger Allen28-Nov-03 5:58
Roger Allen28-Nov-03 5:58 
GeneralRe: final Class Pin
Michael Dunn28-Nov-03 6:37
sitebuilderMichael Dunn28-Nov-03 6:37 

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.