faq

There are a lot of documentation for VRML but not so much for MPEG-4. In addition to a google search, the following site can be read first: Tutorial on MPEG-4 extensions: ENST Tutorial.
The second is a must have reference you should put in your bookmarks VRML reference: Annotated VRML Book.


Is there a console?

Yes. The console can be accessed using keys or touch screen shortcuts.
The console gives access to error messages from the player but also output from your scripts using Browser.print ('mymessage');.

Press the three keys # * # or touch 4 times the upper-left corner of the screen to display it.
A black screen with green text should appear.
To navigate, just use the keypad or touch the screen near the borders.
To get some help press #.
You can hide the console pressing * or by touching the center of the screen.


Why cannot I see any pure VRML examples

This is because MeMo supposes an implicit Layer2D at the beginning of the cene and therefore an implicit 2D context.

Why doesn't the background refresh?

Because there is no automatic background management (for optimization purposes).
Instead use a shape with a size identical to the screen one like in helloWorl.wrl.


Where can I find helloWorld.wrl and what does it do?

Just here:


How do I include a sub scene?

Just specify the name of the scene you want to include in the url field of an Inline (or Anchor) node like: Inline { url “subScene1.m4m” }

The compiler will automatically look for subScene1.wrl and will compile it. This is a recursive process and you can have as many levels of inclusion as you want.


How to get the keys from the keyboard?

Use InputSensor or KeySensor. They both use the same syntax: specify the key you want to sense in the URL field with the following meaning:

You can specify more than one char in the URL field.


Ok, I know how to force inclusion of an image, but what is it for?

when you want to change dynamically an image by script, you can call:
imageTexture.url[0] = imageTexture.url[1]; to assign image1.jpg as the current texture to use.


how to force inclusion of a M4M scene for further use?

This works like for images but for Inline or Anchor, just specify the scene name in the url field. If you do not want the Inline to be active from the beginning, just leave the first item blank (ex: Inline { url [ "" "scene1.m4m" ] }).


What are the benefits to use included M4M scenes?

You can split a big application in several sub scenes to save memory and creation time. This may be mandatory if you use a lot of images. This can be done using a big Switch containing a lot of Inline nodes or by setting, in a script, the url field of a unique Inline.


Why are PROTO reducing code size?

It is first because it uses less lines to call a PROTO than re-defining the code itself and also because PROTO definition are included only once even if you reuse the PROTO in multiple sub-scenes.


How do I include sub-scenes and images when they are PROTO parameters?

It is true that in this case the image or wrl names are not directly assigned to ImageTexture, Inline or Anchor. However, all String parameters to PROTO are automatically scanned for inclusion so everything is automatic for you.


How can a sub-scene kill itself (and thus free resources)?

By using an Anchor node with an empty ("") scene and "self" as parameter.


How can a parent scene know that a scene just suicided?

By listening to the url field of the Inline that referenced the suicided scene. In this case, the (parent) url field is modified to the value set by the (child) Anchor. This can be done by routing the url field to a script (ex: ROUTE INLINE.url TO SCRIPT.listenUrl)


What is exactly the memory used by an image?

This size may vary upon the way the image is used. First, the encoded version of the image is stored inside the M4M. Then when an image is used it is expanded in video memory and the memory needed is width*height*4 bytes. This may be much more than the encoded image. Further, in 2D mode, if you scale or rotate the image a copy of the image is created to store the modified pixels.


What are the supported formats for images?

PNG, including translucent and GIF (but not animated).


How to open a 2D context for rendering 2D Nodes?

By default a 2D context is opened, you can open another one (for clipping purposes by example) using Layer2D.


What are the main restriction of the Script node?

First the number of fields (and thus functions) is limited to 250. Further, the script functions are compiled during the M4M creation process. The biggest limitation is that, for efficiency reasons, you cannot use on the fly discovery of fields, everything must be resolved at compile time. This means that you cannot directly iterate through an array Nodes (see trick below).


How to iterate through an MFNode?

This can be done only when all nodes inside the MFnode have the same type that is known at compile time. The trick is to use an SFNode set to the target type and set this SFNode to be an element of the MFNode:


How do I specify quote or double quotes in a script?

This is a trap because the string is evaluated twice: one at the VRML level and one at the javascript level, so you have to double-backslash your quote like this: "a \\\' b" is first evaluated to "a \' b" and passed to the javascript compiler that evaluate it in "a ' b"


When I using the emulator, what's describes the mouse's wheel actions?

There are the same than the up/down keys, defines with the KeySensor node.
However, mouse click events can be used thanks to the touchSensor node or the TouchCursor prototype.


What is the floating point?

It is limited to 5 digits ( 1 / 2^17 ). Math.floor(float f) could be useful to manipulate big values.


How can I test my widget offline?

Modify your micro emulator setting during tests : Option > MIDlet network access


What is "Error starting modern compiler"?

Check that JARs referenced in Windows > Preferences > Ant > Runtime and Windows > Preferences > Java > Installed JREs are the same. More info...


How can I configure proxy settings for the micro emulator

The Micro Emulator configuration file is available here:
Windows OS: C:\Documents and Settings\{user name}\.microemulator\config2.xml
Linux OS: /home/{user name}/.microemulator/config2.xml
Add these two lines on your Micro Emulator configuration file: