Sunday, February 10, 2013

Loading obj files and 3D text syntax modification

Last week, Yingfu and Kevin added a new feature of Acumen3D that is loading the .OBJ file.
One needs to declare the type of the object to be "OBJ" and specify the path at the end.
The following example loads the R2D2 robot model:

class Main(simulator)
  private
    _3D :=["OBJ",[0,0,0],1,[0,0,1],[3.14/2,0,0],"robot/r2d2.obj"];
  end
    _3D = ["OBJ",[0,0,0],1,[0,0,1],[3.14/2,0,0],"robot/r2d2.obj"]
end

Currently, all the related files(.obj, .mtl and textures) should be located under the _3D folder in the main directory.
The syntax of 3D text was also changed, the type has to be "Text" and the content should be specified at the end.