CreateCube

Blitz3D Forums/Blitz3D Beginners Area/CreateCube

Razvan99(Posted 2013) [#1]
I have another problem . When i`m compiling :
cube = CreateCube(32)
I got an error which says that "parent etnity does not exist"
Could you help me out ?


Yasha(Posted 2013) [#2]
The parameter to CreateCube is the entity it should track as its parent, or 0 (or just not write it) if you don't want it to track any parent.

32 is not an entity handle, so it doesn't work. Entity handles are represented as numbers, but they must be a valid address of something that's already been created. They're also not constant from run to run since things will often be created in different positions, so it's not worth noting down the handle of a valid entity to write into your program later; you must use a variable (or... other dynamic expression, anyway) for this.

What are you trying to do with that 32? A cube doesn't have variable smoothness or anything so it doesn't need a level-of-detail argument the way spheres and cylinders do.


Razvan99(Posted 2013) [#3]
32 segments.


Midimaster(Posted 2013) [#4]
CreateCube() has no parameter "segments"!


Floyd(Posted 2013) [#5]
CreateCube() has no parameter "segments"!

I think it did in the very distant past. The idea was that the extra triangles made it respond more smoothly to lighting.

But that's long gone. Any reasonably up to date version has only one parameter, the parent.


Yue(Posted 2013) [#6]

Pivot% = CreatePivot()
Cube2% = CreateCube(Pivot%)

While Not KeyHit(1)

    TurnEntity Pivot%,1,1,1
    RenderWorld
    Flip True
Wend