Basic Scene Building And Maintenance
First, before you try to build or modify a scene, realize that you have to
have a programmer or wizard bit on the server. Then realize that you will
need to borrow one of the player characters since I haven't gotten around
to modifying the programmer hierarchy yet.
Building A Scene
The steps in building a scene are as follows
@create $g.scene_root named "SomeName"
. See also
@help @create
. Just leave the scene where it is
(it will normally be created in your inventory).
- If you forget which object number you created, use
@kids $g.scene_root
. If you want to see the objects
in a scene, the command is
;$g:show_scene()
where is the object number
of either some object in the scene or the scene root for that scene.
- A scene root doesn't have any geometry associated with it. Its just
used to let the client know reliably when to stop asking about objects
when building the scene.
- The simplest way to create geometries is to create instances of #242.
That class has four useful properties
- name
- The object's name
- location
- Where the object is
- position
- local x,y,z coordinates
- orientation
- local rotation vector
- url
- the object's url
The command to set these properties is
;< ObjectNumber>:set(< name>,< value>)
where ObjectNumber is an object number (with the hash sign), name is a
property name in quotes, and value is the new value. Please note that
location and position are specified as lists with an opening curly bracket,
a closing curly bracket, and seperated by commas.
An example
In this example, responses from the server will be intended two spaces.
@create #302 named "My Scene"
You now have My Scene with object number #341 and parent Generic Scene Root
(#302).
@create #242 named "My Room"
You now have My Room with object number #345 and parent Generic (#242).
;#345:set("location",#341)
=> #341 (My Scene)
;#345:set("url","http://caithness.cs.ndsu.nodak.edu/~vender/WRL/Cell/cellmembrane.wrl")
=> "http://caithness.cs.ndsu.nodak.edu/~vender/WRL/Cell/cellmembrane.wrl"
;$g:show_scene(#341)
#341 (My Scene)
#345 (My Room)
=> 0
Okay, at this point you have a fairly boring scene (just a cell membrane).
So the next step is to create some things in the room as so
@create #242 named "Nucleus"
You now have Nucleus with object number #346 and parent Generic (#242).
;#346:set("url","Cell/nuc.wrl");
=> "Cell/nuc.wrl"
;#346:set("location",#345);
=> #345 (My Room)
;#346:set("position",{10,0,0});
=> {10.0, 0.0, 0.0}
If you are watching the window, you should see the nucleus moving.
Since this can get very tedious fast, there is an additional thing you can
do.
;$g:clone(#346)
=> #347 (Nucleus)
;#347:set("name","Second nucleus")
=> "Second Nucleus"
;#347:set("position",{-10,0,0})
=> {-10.0, 0.0, 0.0}
$g:clone makes an exact replica of an existing object, up to the point
of placing it in the same position.