Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Use array to show trees but errors occur(VC++6)  (Read 433 times)
baiqian
Community Member
*
Posts: 7


« on: December 21, 2007, 02:03:42 AM »

I add trees use TVActor as below, but it shows as the pic, anyone know??
I also has an character in mdl, using TVActor to load, the pointer is pActor.
Can ITVActor define more different objects pointers? I try load one chracter and one tree use 2 different pointers(pActor and pTree both are ITVActor ponters), but when I compling and run, the programme show the character and tree overlapped.


ITVActor pTree[500];
......
pTree[500] = CreateTVActor();
 
 
 
int treenum;
 float treex, treey, treez;
    float treernd = rand()%100*0.001f;
 
 for(treenum = 1; treenum<500; treenum++)
 {
         treex = treernd * 4;
         treez = treernd * 4;
         treey = pLand->GetHeight(treex, treez) + 5.0f;
         pTree[treenum]->load("..\\media\\tree\\tree1.mdl, tvtrue);
         pTree[treenum]->SetPosition(treex, treey + 35.0f * 3.0f, treez);
         pTree[treenum]->SetScale(0.5f, 0.5f, 0.5f);
       
 }
 
.......
pTree[500]->Render(tvfalse);
......

 pTree[500]->Release();
 pTree[500]=NULL;
Logged
ZaPPZion
Community Member
*
Posts: 341


« Reply #1 on: December 21, 2007, 04:23:51 AM »

if this is a copy-paste part...
pTree[treenum]->load("..\\media\\tree\\tree1.mdl, tvtrue);
should be:
pTree[treenum]->load("..\\media\\tree\\tree1.mdl", tvtrue);
forgot to close the quotes.
other than that i dont see anything weird.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks