# A cube script

#### 3dslider

##### Member
Hi,

Making a cube with 4 subdivision, good but some points is adding in cube... If someone know on how to fix that ? Thanks.

Happy coding !

View attachment Cube.zip

#### Sensei

##### TrueArt Support
Start from drawing cube on piece of paper.
Assign values to them.

e.g.
left most X = -1
right most X = +1
(repeat for other axes as well)

You will have list of vertexes e.g.
-1.-1,-1
+1,-1,-1
+1,+1,-1
-1,+1,-1

-1.-1,+1
+1,-1,+1
+1,+1,+1
-1,+1,+1

There must be 8 vertexes for cube.

You will also need list of vertexes. There will be required 6 such. Each with 4 vertexes.

1,2,3,4
5,8,7,6 // flipped order
1,2,6,5
2,3,7,6
3,4,8,7
4,1,5,8

(you will probably have to fix order of vertexes)

#### Kryslin

##### Active member
You know, you could just use the makebox(<one corner>,<opposite corner>,<x segments, y segments, z segments> modeler lscript command...
Code:
``````main{
makebox(<0,0,0>,<4,4,4>,<2,2,2>);
}``````

And achieve the same result with less code.

Much simpler, and Lightwave does the fiddly bits for you.

#### 3dslider

##### Member
Thank you all guys !