Domanda

i am a newbie in cocos3d. I wan to draw a line using cc3linenode.

Here is the code

float arr_location[] = {x,y,z, dx,dy, dz };
CC3LineNode* lineNode = [CC3LineNode nodeWithName: @"Line test"];
[lineNode populateAsLineStripWith: 2
                         vertices: arr_location
                        andRetain: YES];
lineNode.color = ccGREEN;

[_lines addObject:lineNode];
[_activeWorld addChild:lineNode];

But when i try this, i get an error like this

Instance method populateAsLineStripWith: vertices: andRetain: is not found(return type defaults to 'id')
È stato utile?

Soluzione

did you import?

#import "CC3ParametricMeshNodes.h"

you error gives you unfound instance of method, so you just need to make right import with that method

found answer here

proof screenshot

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top