Make your own free website on Tripod.com

HowTo FreeCube - by Andrea Marchini



First you need to put ad applet tag in your HTML code, take a look at the code of the example.
In the applet tag you have to specify some parameters as follow:

Name: lightr, lightg, lightb
Meaning: red,green and blue components of the directional light color, float value
Default: 1.0
Example: < param name="lightr" value="0.0">
param name="lightg" value="0.5">
param name="lightb" value="0.5">
set the light color to yellow

Name: lightar, lightag, lightab
Meaning: red,green and blue components of the ambient light color, float value
Default: 1.0
Example: < param name="lightar" value="1.0">
param name="lightag" value="1.0">
param name="lightab" value="1.0">
set the ambient light color to bright white

Name: background
Meaning: set the background image of the applet
Default: none
Example: < param name="background" value="background.jpg">

Name: disabled
Meaning: set the image processing algorithm on the texture of disabled faces
syntax:
<algorithm_name>,value1,value2...
where:
<algorithm_name> = (normal|saturation|light|filter)
algorithm normal: no effect, no values after the word normal
algorithm saturation: change the saturation to the value next the word saturation
algorithm light: change the light to the value next the word light
algorithm filter: multiply the channel values with the next three values after the word filter
algorithm emboss: use edge detection filter to create a relief gray image
algorithm negative: change the texture to its negative

Default: saturation,0.0
Example: < param name="disabled" value="filter,0.6,0.0,0.4">
will multiply red channel by 0.6, green channel by 0.0 and blue channel by 0.4


Name: enabled
Meaning: set the image processing algorithm on the texture of enabled faces
syntax:
the same of the above disabled parameter
Default: saturation,0.0
Example: < param name="enabled" value="saturation,0.1">
will produce a near gray scale texture for enabled faces

Name: rotcube
Meaning: rotate the cube when the applet start
Default: true
Example: < param name="rotcube" value="true">

Name: rotlight
Meaning: rotate the light when the applet start
Default: false
Example: < param name="rotlight" value="true">

Name: autoq
Meaning: enable quality control, that enable or disable light rendering techniques if the current fps is greater or minor than the thrfps or minfps values
Default: false
if you omit this parameter, the applet will not use auto quality
Example: < param name="autoq" value="true">
will enable phong shading

Name: phong
Meaning: enable phong shading (heavy calculations!)
Default: false
if you omit this parameter, the applet will not render with phong algorithm
Example: < param name="phong" value="true">
will enable phong shading

Name: gouraud
Meaning: enable gouraud shading (medium calculations)
Default: false
if you omit this parameter, the applet will not render with gouraud algorithm
Example: < param name="gouraud" value="true">
will enable gouraud shading

Name: flat
Meaning: enable flat shading (light calculations)
Default: true
if you omit this parameter, the applet will not render with phong algorithm
Example: < param name="phong" value="true">
will enable phong shading

Name: ambient
Meaning: ambient light, the light that is everywhere in every direction (enabled if any light model, phong or flat)
Default: 0.0
Example: < param name="ambient" value="0.4">

Name: lightintensity
Meaning: intensity of the directional light (enabled if any light model, phong or flat)
Default: 1.0
Example: < param name="lightintensity" value="1.3">

Name: lightdistance
Meaning: the "virtual" distance of the directional light when phong is enabled
should range from 0.0 (say > 0.0) to 1.0
Default: 0.6
Example: < param name="lightdistance" value="0.2">

Name: maxfps
Meaning: the maximum frame per second that the applet will display
Default: if you omit this parameter, the applet will display 20 fps
Example: < param name="maxfps" value="30">
will set the maximum fps to 30

Name: minfps
Meaning: the minimum frame per second that the applet will display (works with autoq)
Default: if you omit this parameter, the applet will display 10 fps
Example: < param name="minfps" value="12">
will set the minimum fps to 12

Name: thrfps
Meaning: the threashold frame per second (if the fps is greater than fps autoq will try to render with a superior light model)
Default: if you omit this parameter, the applet will display 14 fps
Example: < param name="thrfps" value="16">
will set the threshold fps to 16

Name: speed
Meaning: the maximum speed of the cube; the cube will rotate faster if you move away from the center of the applet
Default: if you omit this parameter, the speed will be 12
Example: < param name="speed" value="20">
will set the speed to 20

Name: bgColor
Meaning: the background color of the applet in r,g,b format
Default: if you omit this parameter, the background color will be... black! :-D
Example: < param name="bgColor" value="255,255,255">
will set the background color to white

Name: facex
Meaning: the image that will be used as texture for the face n.x, where x range is from 1 to 6
Default: you must specify an image
Example:
< param name="face1" value="face1.jpg">
< param name="face2" value="face2.jpg">
...
<param name="face6" value="face6.jpg">

Name: linkx
Meaning: the link opened when the user click on the face n.x where x range is from 1 to 6
Default: none
Example:
< param name="link1" value="page1.jpg">
< param name="link2" value="page2.jpg">
...
<param name="link6" value="page6.jpg">

Name: framex
Meaning: the frame where the link of the face n.x, where x range is from 1 to 6, will be loaded
Default: _self
Example:
< param name="frame1" value="frame1">
< param name="frame2" value="frame2">
...
<param name="frame6" value="frame6">

Name: descx
Meaning: the description of the link of the face n.x, where x range is from 1 to 6, that will be shown if the status line of the browser
Default: none
Example:
< param name="desc1" value="first link">
< param name="desc2" value="second link">
...
<param name="desc6" value="third link">

lancepleo.it