Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ardiscript:addshape [2018/04/16 04:09]
optrix [Examples]
ardiscript:addshape [2018/11/16 04:19] (current)
optrix [See Also]
Line 10: Line 10:
  
 ===Shape=== ===Shape===
-//Type: [[Primitave]]+//Type: [[Primitive]]
 Default: None// Default: None//
  
Line 23: Line 23:
 |**polygon**|Creates an asset from a set of [[XY Coordinates]] which will form a customized polygon.| |**polygon**|Creates an asset from a set of [[XY Coordinates]] which will form a customized polygon.|
  
-==Polygon==+===Polygon===
  
 In order to crates a shape of the type //​polygon//,​ multiple [[XY Coordinates]] must be specified using the //points// parameter. See //points// for more information. In order to crates a shape of the type //​polygon//,​ multiple [[XY Coordinates]] must be specified using the //points// parameter. See //points// for more information.
  
-==Points==+===Points===
  
 //Type: Multiple [[XY Coordinates]] //Type: Multiple [[XY Coordinates]]
 Default: None// Default: None//
- 
-//Must only be used if the shape type **Polygon** was specified.//​ 
  
 Each coordinate must be specified and formatted as "X1 Y1,X2 Y2,X3 Y3". At least 3 sets of coordinates must be specified. Each coordinate must be specified and formatted as "X1 Y1,X2 Y2,X3 Y3". At least 3 sets of coordinates must be specified.
  
-==Extrude==+//Must only be used if the shape type **Polygon** was specified.//​ 
 + 
 +===Extrude===
  
 //Type: [[Float]] //Type: [[Float]]
 Default: None// Default: None//
  
 +The amount to extrude from the specified //Polygon// //Points// to convert a flat shape into a 3D shape.
  
 //Must only be used if the shape type **Polygon** was specified.//​ //Must only be used if the shape type **Polygon** was specified.//​
  
-The amount to extrude from the specified ​//Polygon// //Points// to convert ​flat shape into a 3D shape.+===TopAndBottom=== 
 + 
 +//Type: [[Bool]] 
 +Default: **True**// 
 + 
 +Used when the shape type is defined as a //Polygon// type. If true, it will generate ceiling and floor polygons ​to create ​completely solid shape. If false, there will be no ceiling or floor and only the walls of the mesh will be generated. 
 + 
 +//Must only be used if the shape type **Polygon** was specified.//
  
 ===Name=== ===Name===
Line 55: Line 63:
 ===Position=== ===Position===
 //Type: [[XYZ Coordinates]] //Type: [[XYZ Coordinates]]
-Default: 0,0,0//+Default: ​**0,0,0**//
  
 The co-ordinates in which to place the asset within the 3D world. Co-ordinates are defined as "​x,​y,​z",​ separated by a ','​ and no spaces. The co-ordinates in which to place the asset within the 3D world. Co-ordinates are defined as "​x,​y,​z",​ separated by a ','​ and no spaces.
  
-==AttachTo== ​+===AttachTo===
 //Type: Text //Type: Text
 Default: None// Default: None//
Line 67: Line 75:
 If defined, this asset will be parented to the specified asset and it's //​position//​ will be converted to local co-ordinates around the parent asset. If defined, this asset will be parented to the specified asset and it's //​position//​ will be converted to local co-ordinates around the parent asset.
  
-==Color==+===CopyRotation=== 
 + 
 +//Type: [[Bool]] 
 +Default: **True**//​ 
 + 
 +Only used when an //​AttachTo//​ parameter is defined. If true, the asset will attempt to copy the rotation of it's parent. 
 + 
 +===Color===
 //Type: [[RGB]] or [[RGBA]] //Type: [[RGB]] or [[RGBA]]
-Default: 1,1,1,1//+Default: ​**1,1,1,1**//
  
-This parameter sets the color of the new asset. Color must be defined as "​r,​g,​b"​ or "​r,​g,​b,​a"​ using normalized values (from 0.0 to 1.0)+This parameter sets the color of the new asset. Color must be defined as "​r,​g,​b"​ or "​r,​g,​b,​a"​ using normalized values (values ranging ​from 0.0 to 1.0)
  
 ^Parameter^Meaning^ ^Parameter^Meaning^
Line 79: Line 94:
 |**a**|The value for the amount of alpha transparency to be applied. Must be a value ranging from 0.0 to 1.0. //This parameter is optional//| |**a**|The value for the amount of alpha transparency to be applied. Must be a value ranging from 0.0 to 1.0. //This parameter is optional//|
  
-==Texture==+===Texture===
 //Type: [[Path]] //Type: [[Path]]
 Default: None// Default: None//
Line 87: Line 102:
 This applies textures to the new asset, allowing more graphical detail to be added. This applies textures to the new asset, allowing more graphical detail to be added.
  
-==Transparent==+===Transparent===
 //Type: [[Bool]] //Type: [[Bool]]
-Default: False//+Default: ​**False**//
  
 Specifies whether or not to add an additional transparency effect to the new asset. If true, the object will become transparent. Specifies whether or not to add an additional transparency effect to the new asset. If true, the object will become transparent.
 +
 +====See Also====
 +[[addmesh]] [[addbeacon]] [[addparticle]] [[addlinkedpoints]] [[remove]] [[duplicateobject]]
  
 ====Examples==== ====Examples====
  
 <​code>​ <​code>​
-<​addshape Shape="​Polygon"​ Points="​10 10,10 20,20 10" Extrude="​10" Position="​15,15,60" Name="TestShape"​ Texture="​Texture.png"​ Transparent="​true"​ Color="​0.1,​0.1,​1" />+<​addshape Shape="​Cylinder" Position="​67,25,160" Name="TestCylinder" />
 </​code>​ </​code>​
  
-> This will add an asset called **NewObject** to the 3D world, using the file **test.obj** as a mesh. It will be created and positioned ​at the x,y,z co-ordinates:​ 0,2,respectively. It will also have a color added with the respective r,g,b values 0,0,1 which will give it a shade of blue.+> This will create a new asset of the primitave shape type **Cylinder** at the x,y,z coordinates "67,25,160" ​respectively ​and give the asset the name **TestCylinder**.
  
 <​code>​ <​code>​
-<​addshape Shape="​Cylinder" Position="​67,25,160" Name="TestCylinder" />+<​addshape Shape="​Cube" Position="​30,25,100" Name="TestCube"​ Texture="​GlowingEdges.png"​ Transparent="​true"/>
 </​code>​ </​code>​
  
-> This will add the same **NewObject** to the 3D world, but also attach it to another asset called **AttachToThis**. Since an //​AttachTo//​ parameter was specified, ​the x,y,z //​position// ​coordinates will become local to the asset called ​**AttachToThis**.+> This will create a new asset of the primitave shape type **Cube** at the respective ​x,y,z coordinates ​"​30,​25,​100"​ . It will have the name **TestCube**, have a texture imported from the file **GlowingEdges.png** and be set to //​Transparent//​.
  
 <​code>​ <​code>​
-<​addshape Shape="​Cube" Position="​30,25,100" Name="TestCube" Texture="​GlowingEdges.png" Transparent="​true"/>​+<​addshape Shape="​Polygon"​ Points="​10 10,10 20,20 10" Extrude="​10" Position="​15,15,60" Name="TestShape" Texture="​Texture.png" Transparent="​true" Color="​0.4,​1,​0.4" />
 </​code>​ </​code>​
  
-> This will create the same **NewObject** asset againhowever this time it will apply a texture from the file **texture.png**.+> This will add an asset called ​**TestShape** to the 3D world of type //​polygon//​. The //polygon// will have the 3 points 10 1010 20, 20 10 respectively and an //extrude// height of 10. 
 + 
 +> It will be created and positioned at the x,y,z co-ordinates:​ 15,16,60 respectively. It will also have a texture ​imported ​from the file **Texture.png**, be set to //​Transparent//​ and have a color of 0.4,1,0.4 which should create a shade of light green.