Programming Interface

  • Email
  • Sharebar
  • Email

Programming Interface


The main programming interface consists of four menus, an interactive message text area, an immediate command text field, and a help button. Please move you mouse over the image below to get a help text, or click on the any places of the image to see detailed description.

  • Interactive message text area: The text message here reports some system information and responds to any commands including procedures. It is important to pay attention to the message here for debugging your programs. You can also treat this message area as the history for tracing your past commands.
  • Immediate command text field: This is where you can specify your commands to the turtle or VRMath system and get immediate results. When you want to type in commands, please use your mouse click in the text field to get focus. You can also use up and down keys in the text field to get the commands you used before.
  • Help button: Click on this button will display the command library page in the right HTML frame.

Project Menu

To use the functions in this menu, you will have to register and login in VRMath forum. Move your mouse over the image below to get help text, or click to see more info. 

New Project

Create a new project will erase all variables and procedures in memory. You will be notified when you have any procedures in memory. When a new project is created, the title bar of VRMath will display your project's title. You can change project's properties later in project properties function.

Open Project

You can open your own projects or projects which have been made public by their authors. Click on My project button to show a list of your own projects, or click on Public projects button to show a list of public projects. Select a project in the project list, and click Open button to open. Open a project will erase all defined variables and procedures in memory. VRMath will prompt a dialog to notify you before opening a project. You can open public projects but you cannot change them. You will have to save the public projects to your own projects if you want to keep them.

When a project is opened, VRMath will prompt a Project description dialog to show the project properties as shown in the image below..

Save Project

This function will save any changes made to project properties and procedures in current editing project. No dialog will display, only a message will appear in the Interactive message text area. However, if it is a new project or a public project from other author, VRMath will show the Save Project as dialog for this function.

Save Project As...

This function can make another copy of current editing project. You can change the project title, description, and public status of the project.

Export VRML

VRML is the file format used in VRMath. You can mark the VRML codes in the Export VRML dialog, press Ctrl+C to copy it, and press Ctrl-P to paste it to other text editing programs such as notepad. Save the codes as some_file_name.wrl to be a standard VRML file. Then you should be able to view it in another web browser by double clicking on the .wrl file. For more infomation about VRML, please see Technical documents.

Delete Project

If there is currently an opened your own project, this Delete function will permanently delete the project. There will be a message in the interactive message text area for this action.

Project Properties

This function shows you the dialog below, which allow you to review or change your project properties.


Edit Menu

Procedure Editor

This function gives a procedure editor window, which allows you to write procedures. For how to write procedures, please visit the tutorial page. Click on the procedure or edit buttons will each get a menu.

Procedure menu

  • Execute without closing: Execute the procedures in this editor window without closing this window. This is recommended for new users on Logo procedure writer.
  • Execute and exit: Execute the procedures in this editor window and close this window. If the procedures have any errors in syntax, the procedures won't be defined. And because the editor window is closed, you will lose the procedures.
  • Exit: Close this editor window without any execution.
Edit menu (Procedure editor)

Because of the security reason of Java Applet, VRMath uses its own clipboard for cut, copy, and paste. If you want to use the Windows system's clipboard, please use keyboard instead:

  • Ctrl+z: Undo
  • Ctrl+y: Redo
  • Ctrl+x: Cut selection
  • Ctrl+c: Copy selection
  • Ctrl+v: Paste copied selection

  • Undo: undo last editing, this function will prompt a dialog that tells you to use key Ctrl+z instead. 
  • Redo: redo last editing, this function will prompt a dialog that tells you to use key Ctrl+y instead.
  • Cut: cut selected texts to VRMath's clipboard.
  • Copy: copy selected texts to VRMath's clipboard.
  • Paste: paste copied texts to editors (at cursor's position).

Procedure List

Open into editor will show the procedure list dialog, which allows you to edit multiple procedures in one editor window or delete procedures.

Undo

This special command "undo" will remove the last object created in the 3D space. Please note that PENDOWN or PD command is the beginning of an object, PENUP or PU command is the end of the object. If you just want to erase one track of the turtle, please use PE (PENERASE) command.

Redo

This special command "redo" will add the last undo object into the 3D space.

Clear History

This function clears the texts in the interactive message text area. 


Tool Menu

These tools are helpful in constructing 3D objects. Please move your mouse over the menu below to see help text, and click to go to the function dialog's image.

Background Chooser

There are two types of background in VRMath. You can choose color only background by clicking the Color button, and select from the combo drop down list. You can also choose a panorama style background by clicking the UniversalMedia button and select from the drop down list below.

When you have selected a background, you can examine in the 3D space in Background Chooser dialog by dragging your mouse in. Click on OK button to accept change of background for VRMath.

Pen Color Editor

This Pen Color Editor provides 70 fixed colors. You can also use the color canvas or R G B scroll bars to create the color you want. The color chosen in this dialog is for the turtle tracks when PENDOWN. The Copy button will copy the color command into VRMath's clipboard. Then you can paste the color command in writing procedures.

Font Chooser

The Font Chooser works with LABEL command. 

Material Editor

This Material Editor works with BOX, CAN, CONE, BALL objects, and also PENDOWN object when FACE and PCON (PENCOLORON) commands are specified.

You can choose material from built in categories, or adjust six elements of material to create special material:

  • diffuse color: this reflects all VRML light sources depending on the angle of the surface with respect to the light source. The more directly the surface faces the light, the more diffuse light reflects.
  • emissive color: this models "glowing" objects. This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.
  • specular color: The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, thespecularColor is added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
  • shininess: The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColoris added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
  • ambient intensity: this specifies how much ambient light from light sources this surface shall reflect.
  • transparency: specifies how "clear" an object is, with 1000 being completely transparent, and 0 completely opaque.

All six elements are ranging from 0 to 1000.

Quick Command

This Quick Command tool integrates 34 commands in one dialog. It is helpful for beginners in VRMath and even experts.

When you move the mouse over the icons, you will see the associated command display in the text field (just above the "Warning: Applet Window" message). 

For more information regarding these 34 commands, please see Command Library page.

Options

This sets the globe turtle waits in mini-seconds from 0 to 1000 (1 second). If you want the turtle to draw quicker, set the waits to smaller number. If you want to see how the turtle moves, set the waits a bigger number.

This turtle waits affect any moving and turning commands.

The default wait is 20ms.

You can also use WAIT command in your procedure, if you need special animation or longer waits.


Environment Menu

  • Reset Environment will clear all variables and procedure, and terminate any unfinished commands.
  • Interrupt will terminate any unfinished commands. This is useful when the program ran into a infinity loop, or you want to stop the execution at any time.