# Developing a advanced 3D game engine

This topic is 2610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

if you read the book programming role playing games,you must remember the function as below:
if(Size > m_MaxSize && Num > m_MaxPolygons) {
if(Size > m_MaxSize && Num > m_MaxPolygons) {
XOff = (((i % 2) < 1) ? -1.0f : 1.0f) * (Size / 4.0f);
ZOff = (((i % 4) < 2) ? -1.0f : 1.0f) * (Size / 4.0f);
YOff = (((i % 8) < 4) ? -1.0f : 1.0f) * (Size / 4.0f);

// See if any polygons in new node bounding box
if(CountPolygons(XPos+XOff,YPos+YOff,ZPos+ZOff,Size/2.0f)) {

Node->Nodes = new sNode(); // Create new child node

// Sort the polygons with the new child node
SortNode(Node->Nodes,XPos+XOff,YPos+YOff,ZPos+ZOff,Size/2.0f);
}
}

// See if any polygons in new node bounding box
if(CountPolygons(XPos+XOff,YPos+YOff,ZPos+ZOff,Size/2.0f)) {

Node->Nodes = new sNode(); // Create new child node

// Sort the polygons with the new child node
SortNode(Node->Nodes,XPos+XOff,YPos+YOff,ZPos+ZOff,Size/2.0f);
}
}
Ok so jog your mind what 's mean with thease code?:
if(Size > m_MaxSize && Num > m_MaxPolygons) {
XOff = (((i % 2) < 1) ? -1.0f : 1.0f) * (Size / 4.0f);
ZOff = (((i % 4) < 2) ? -1.0f : 1.0f) * (Size / 4.0f);
YOff = (((i % 8) < 4) ? -1.0f : 1.0f) * (Size / 4.0f);

please explain thease code to me special on how to caculate the xOff and ZOff and YOff value,tell me where they come?

##### Share on other sites
If you got that from a book it should explain in there. Reread the chapters carefully. It helps me if I take notes as a read to make sure my eyes don't gloss over and I stay alert and focused on what I'm reading.

##### Share on other sites
can you use the code tags please

##### Share on other sites
Your guys don't know the expalin of thease code is so rude for me,I read that section again again,but no words can give me a way to slove it understand it!so don,t delay my time,just to explain it that is all!

##### Share on other sites
Here's the thing... without the code we can't explain. Software is highly context specific. We're not going to go out to buy the book just to answer your question either. Is there a URL provided in the book that you could use to contact the author?

##### Share on other sites
Looks like this is a cross-post.

##### Share on other sites
Its a double cross post. He has the same question in two other posts too.

##### Share on other sites

Your guys don't know the expalin of thease code is so rude for me,I read that section again again,but no words can give me a way to slove it understand it!so don,t delay my time,just to explain it that is all!

The way I see it no one in this thread tries to "delay your time". I see nice people trying to help you. Perhaps you should reconsider the way you communicate with the helpful people. After all they are helping you without getting paid for it(and that is a very noble thing to do). Also you should use Landlocked's advice.

1. 1
2. 2
Rutin
19
3. 3
JoeJ
16
4. 4
5. 5

• 35
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001808
×