| further reading | more topics » |
| mjbWorld program | 3D theory |
3D physics |
3D maths |
3D programming | technology |
about site |
sitemap A-Z |
about |
white paper |
download program | user guide |
programmers guide | source |
bugs |
to do |
| index | tutorial | modelling | animation | reference |
| index | games | physics | interpolation | keyframe | script |

This particular script loads a green box, to see it click on front view:

You can use any text editor such as notepad to enter your own script file. The advantage of using a Bean Shell script is that it is written in Java, so once a script is developed, if it is useful it could potentially be compiled to a bean and turned into a part of the program.
The example script looks like this:
import mjbModel.*;
import mjbWorld.*;
transformGroupBean tg = new transformGroupBean();
shape3dBean shape = new shape3dBean();
boxBean box = new boxBean();
appearanceBean appearance = new appearanceBean();
materialBean material = new materialBean();
material.setDiffuseColor(new sfcolor(0.5f,0.9f,0.1f));
scene.add(TG);
tg.add(shape);
shape.add(box);
shape.add(appearance);
appearance.add(material);
The beans available are listed in Programmers guide here
typical methods available in these beans are:
add(node_bean nb)
add a bean to the scene under this bean.
setParameter(parameter)
getParameter()
i.e. uses the standard beans conventions for setting and getting parameters. For example to set the diffuseColor property use setDiffuseColor(sfcolor) as in the above example.
|
metadata block
|
|
| see also: |
|
| Correspondence about this page | |
|
Book Shop - Further reading. Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them. |
|
|
Commercial Software Shop Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them. |
|
|
Can you help? Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page. |
|
|
progam I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here: |
|
This site may have errors. Don't use for critical systems.
Copyright (c) 1998-2008 Martin John Baker - All rights reserved.