Anfy 3d 1.0 - Copyright (C) by F. Ciucci & A. Fasce 1999
- OVERVIEW:
Anfy 3D is a java applet able to display animated virtual worlds, calculated in real time, including texture mapping, shading, transparency, motion blur, fog, antialiasing. It runs without need of plugins on all the java enabled browsers, starting from Netscape 3 and Explorer 3.
The actual 1.0 version is able to read .a3d files and VRML files, optionally packed in ZIP archives.
The VRML support is not full, but most objects, including textures, will be correctly displayed.
The best results, especially complex animation, will be reached using .a3d files, wich are generated by a 3D Studio Max plugin, included in this archive, under the /maxplug folder. We plan to support other 3d modeling programs in future releases, but for now to make .a3d files you must own 3D Studio Max.
The actual 1.0 version does not support interaction with objects, but we plan to add it in future versions.
*************************************************************** - ANFY 3D 1.0 FEATURES - ***************************************************************
- VRML and 3D Studio Max support for 3D scenes generation. - Full 24bit color rendering. - Compatible with all browsers (including old 3.x versions). - Full 32bit z-buffering that let you show objects wich. compenetrate each others. - Fastest java 3D shaded rendering available today. - Support for realtime omni lights and lightballs/flares. - Support for transparent materials. - Support for realtime digital filters including antialiasing, blur, gaussian blur and blur-motion. - Realtime fog. - Really small and compact applets (23Kb as jar and 44 as .class). - Zip compressed scenes can be used saving downloading time. - Two different renderers: one for really fast flat graphics and one for really fast gouraud-shaded graphics. - Three different illumination systems inside the gouraud-renderer. - Speed can be modified from html to obtain the maximum feel on every machine. - Support for complex transparent-shading effects. (you can easily design a scene wich fades away inside a background) - No limits of complexity for scenes.
*************************************************************** - THE JAVA APPLETS - ***************************************************************
The java applets are stored in the /samples folder.
Java applets are .class files, optionally stored in .jar archives. To make a java applet work, you have to copy in your site all the .class and .jar files, along with the images required, and to insert an <applet> tag in your html document.
We suggest to download our other product, Anfy Java:
http://www.anfyjava.com/ajdownl.html
It contains many samples and detailed informations on this subject. TOP
Note: The smaller jar files will be loaded by browsers ver. 4 and earlier, and .class files will be loaded only by old 3.x versions. Be sure to upload both versions.
Rather than making one applet capable of loading VRML and .A3D, we made smaller different versions for each task:
anfy3dg.class (anfy3dg.jar) : Applet wich loads .a3d scenes with shading
anfy3dvrml.class (anfy3dvrml.jar) : Applet wich loads VRML with shading
You will simply have to use the right version, depending on the type of file you want to display. The applet parameter are very similiar.
We made a variant of anfy3dg too:
anfy3df.class (anfy3df.jar) : Applet wich loads .a3d scenes without shading
This is a smaller and faster version without the shading capability; in some scenes the shading is not required and using this version is preferred.
We don't made a vrml loader without shading.
You will notice anfy.class and Lware.class files. Be sure to upload those too, to make Anfy 3D working on 3.x browsers.
*************************************************************** - THE APPLETS PARAMETERS - ***************************************************************
Insert the <applet> tag in your html document as follows to add this applet to your page (Comments after the ";" symbol are code explanations and acceptable min/max values. They are not part of the applet language):
Note: here we use anfy3dg, but parameters are valid for anfy3df too. TOP
<applet archive="anfy3dg.jar" code="anfy3dg.class" width=350 height=260> <param name=credits value="Applet by Andrea Fasce (www.anfyjava.com)"> <param name=regcode value="NO"> ; Registration code (if you have it) <param name=reglink value="NO"> ; Optional URL link when the applet is "clicked". <param name=regnewframe value="YES"> ; Reglink opened in new frame? <param name=regframename value="_blank"> ; Name of new frame for reglink <param name=statusmsg value="Anfy 3d applet"> ; Statusbar message <param name=filter value="blurmotion1"> ; Optional filter to apply <param name=lightmodel value="dist"> ; Light model ("flat,dist,real") <param name=ambient value="0.1"> ; Ambient illumination (0.0 .. 1) <param name=speed value="180"> ; Speed of scene replay <param name=scene value="Temple.a3d"> ; a3d or VRML scene to load <param name=ziparc value="data3d/Temple.zip"> ; Optional zip archive for scene <param name=gfx_path value="textures/"> ; Path where load graphics <param name=lightmap value="light.jpg"> ; Light map to load (if required) <param name=facenum value="2000"> ; Max number of faces showable <param name=background value="rgb000000"> ; Background color or image <param name=fog value="true,50,1200"> ; Fog (true or false, near, far) <param name=far_clip value="2000"> ; Don't show objects after this value <param name=memdelay value="1000"> ; Memory de-allocation delay <param name=priority value="3"> ; Task priority (1..10) <param name=MinSYNC value="10"> ; Min. milliseconds/frame for sync Sorry, your browser doesn't support Java. ; Message for no java browsers. </applet> ; End of applet tag
The following instructions detail how to change parameters:
Attempting to change the credits parameter will disable the applet.
To activate the reg parameters read the shareware registration notes. In the "regcode" parameter, place the registration code you purchased from the author. If the code is correct and the applet is run from the registered domain name, you can use "link" parameters to link to a URL when the applet is "clicked".
If you set "regnewframe" to "YES", you can specify a specific frame location for the reglink:
"_blank" : To load the link in a new blank unnamed browser window. "_self" : To load the link into the same window the applet occupies. "_parent" : To load the link into the immediate FRAMESET parent. "_top" : To load the link into the top body of the window.
You can also set a custom frame name, such as "myframe1".
The size of the applet is determined by the "width" and "height" tags.
Note: every size is allowed, but bigges sizes will result in slower animation and higher CPU performance requirements.
The parameter "filter", can be set to activate some special filters, here is a list of the values it supports:
-"none" No filter will be used.
-"antialias" Antialias filter will be used. TOP
-"blur1" Blur filter will be used.
-"blur2" Precise blur filter will be used.
-"mixing1" If you selected a background, the scene will be transparent and will let you see the background. Transparency is addittive so if you use this kind of mixing with a white background you won't see anything except white.
-"mixing2" If you selected a background, all the scene will be transparent and will let you see the background loaded. Transparency is medium.
-"blurmotion1" Blurmotion will be used.
-"blurmotion2" Blurmotion with colorize will be used.
The parameter "lightmodel" controls the shading algorithm, wich can be:
-"flat" If you want flat shading (distance from light is ignored).
-"dist" Illumination is based ONLY on the distance from a light.
-"real" A mixing of the other two: distance is important, but also the angle at which rays hit a face.
Note: The "lightmodel" parameter is ignored in anfy3df version.
The parameter "ambient" controls the ambient illumination. It can assume values in the range from 0.0 to 1.0.
The "speed" parameter determine the replay speed. It can have not much effect as the effective speed of computer where the applet is run.
In the "scene" parameter you have to specify the .a3d file to load.
You can optionally store the .a3d scene in a zip archive to save download time and space. You will have to specify the fine name and path in the parameter "ziparc". If you don't use this parameter, the scene won't be loaded from an archive.
Is useful to place the texture images in a separate directory. To specify this directory path, use the "gfx_path" parameter. If all the images are in the same directory of the classes don't use this parameter.
NOTE: When loaded, the texture are internally converted into 256x256 size. It's better to use texture of this dimension to have the mapping identical to 3D Studio Max. Otherwise, you can use smaller square textures, for example 32x32 or 128x128), but the textures quality can become too low if are used in the scene as very stretched ones.
We don't encourage you to use non squared textures, and it's not useful to use textures bigger than 256x256.
If your scene requires one, be sure to specify the light map image file to load in the "lightmap" parameter. If you don't specify a lightmap, a white box will appear in it's place.
The "facenum" parameter specify the max number of faces showable in a frame. It's usually set to 2000, and this is ok for most uses, so don't touch this oarameter, except in the case of very large scenes where you see lost polygons.
The background, if visible, can be determined by the "background" parameter. This parameter can be used in two ways:
1) If the value starts with the string 'rgb' the subsequent number will be the hex rapresentation of the desired background color in red, green and blue components (same as the HTML #rrggbb color notation), example:
"rgbffffff" -> Background is white. "rgbff0000" -> Background is red.
2) If the value don't start with the string 'rgb', it will be used to load a gif or jpg image file, specified. We don't suggest to call this image with with a name starting with "rgb".
Optionally, you can activate the fogging, with "fog" parameter. The fog is dark up to full black in normal mode, and is a trasparency factor in the "mixing" filter mode. It contains 3 statemens separated by ",":
"trueorfalse,nearfogstart,farfogfull"
-"trueorfalse" Can be "true" or "false" and is used to activate or deactivate the fog. TOP
-"nearfogstart" Is the distance from the viewer at wich the fog starts.
-"farfogfull" Is the maximum distance the viewer can see. After the far distance an object is no more visible.
Note: The "fog" parameter is ignored in anfy3df version.
The "far_clip" parameter determine the max distance an object can go without being "clipped" to speed up the scene. It's set by default to 2000, so WARNING: objects after this distance from the viewer will be NOT DISPLAYED. If your objects are too big, and the far_clip parameter is lower, you will see no objects; in this case, we suggest to make the objects smaller and/or increase the far_clip parameter, to contain your scene size.
- A note about the anfy3dvrml version:
It has some additional parameters, to handle objects rotation and size:
<param name=zoom value="80"> ; Dimension of the scene.
<param name=rotate value="0.1,0,0"> ; Rotation of the scene (only objects will be rotated and not lights).
<param name=lightval value="10,100">
This parameter is used for all the lights: the first number is used to decide the radius of the lightball (if you want to show a lightball). If you don't want lightballs just put it to 0 The second number is the maximum ray of illumination of a light.
*************************************************************** - THE VRML SUPPORT - ***************************************************************
The actual Anfy 3D 1.0 VRML reader supports:
-Handle UV texture mapping. -Object (or scene) is centered and sized with the zoom parameter in html. -Animated allowed using the rotate parameter in html. -Handle of multiple objects and multiple materials. -Support for transparent materials. -Support up to 131072 points/faces/materials.
It does not support:
-Primitives (uncheck any button wich specify 'use primitives'). -Doesn't handle hierarchy.
*************************************************************** - THE 3D STUDIO MAX PLUGIN - ***************************************************************
INSTALLATION:
Just copy the file anfy3d.dle inside the pligins directory of your 3dsmax. Next time you'll use the export function inside the file menu you'll notice a new export format called Anfy3D.
Note: There are two versions of the plugin: one for max1.x and one for max2.x, inside the /maxplug folder. Be sure to install the right one.
USE:
The plugin can handle:
- Any kind of object wich can be transformed into a trimesh. - Target cameras. - Omni lights. TOP
Please consider that in your scene there will be some unknown nodes: those are nodes not renderable (for example the camera target), but are exported because their position is used by other nodes (for example a dummy object is saved as an unknown object).
Unknown nodes are usually:
- Camera targets - Hidden nodes - Dummy objects - Everything the engine can not render
Animations are directly exported from actual max animation. The plugin can handle these kind of animations:
- Camera animation, camera roll and camera fov. - Object positions, rotations and scale (scaling only around axis x,y,z). - Omni light positions.
Lights:
Actually only omni lights are supported, and they're used to illuminate the scene or the light-sensitive materials (it depends on what kind of rendering you're using). To set up a light just place an omni light where you want and edit those parameters:
-"color" Actually is unused, but may be used by future releases.
-"near start attenuation" This is used to tell the engine the radius of the flare shown on the screen when the light is visible. If you don't want flares, just use 0 as radius.
-"near end attenuation" This is used to tell the engine the radius of the illumination sphere. Since illumination is done using a lenght-based system, a bigger radius corresponds to a more distant illuminated object. Please note that if you only want to show a flare wich doesn't emit light, just set this value same as the near start attenuation.
-"multiply" Used to tell the engine how much bright is the light.
Materials:
Materials are automatically exported.
The plugin can handle:
- The diffuse color: Only the rgb will be exported. It will be used for flat materials.
- The opacity factor: If opacity is greater than 50 the material will be solid; if it's smaller than 50 the material will be transparent (additive transparency).
- The diffuse map: If you want your object to be texture mapped, just set a diffuse map. Actually only the bitmap type map is supported, in "JPG" or "GIF" formats only. No "TGA", "TIF", "BMP" or other formats are allowed. The preferred size is 256x256; in any case, be sure to use square textures to mantain max mapping coordinates, because Anfy 3D will resize all them to 256x256.
Please note that the bitmap name will be directly exported by the plugin. So you'll have to copy all the bitmaps (also called textures) used in the dir where there's your final .a3d scene file.
If you don't use the diffuse map the material will be only a colored material.
If you don't assign materials to an object, it will be shown with the wireframe color (the color that you can see directly into 3dsmax windows) with a flat rendering.
SAVING:
When you've finished to create a scene, just choose export and select anfy3d file format. TOP
An export dialog will pop up: here you can select if you want to export a log file of all the generation of the .a3d (useful for debugging) or if you want to sample the scene using the number of frames you want.
Then just choose OK.
Two file will be generated:
'filename.a3d' 'filename.log'
The .a3d file is the scene, the .log file can be useful when something doesn't work.
After you've exported the scene what you have to do is to modify the <applet> tag to point to your .a3d scene, to copy all the textures etc inside the same dir or the one specified in "gfx_path" parameter.
ANIMATION INFO:
Please also note that when playing an animation the keys are interpolated linearly, (tcb etc are totally ignored); so, if you want to improve the quality of interpolation to emulate a tcb spline or any other interpolation, just increase the number of keys used. You can do this by selecting the 'Track Editor' inside 3dsmax, then choose the 'new key' button and start to add keys inside the desired path.
Note that when adding keys, 3dsmax will automatically add right keys, so the only thing you have to do is point and click, point and click etc.
Another way you can do this is to force the plugin to generate the number of keys you want for a scene; to use this option just check the interpolate button and specify the number of keys you want.
If you use more keys the animation will be more similar to the original, but the file will be bigger. Using a number of key equal to the number of frames you're actually using will show an animation identical to the one you see in 3dsmax, but the file will be really big.
Usually, to have smaller files, it's better not to use the interpolate option, and to add keys directly from the trackview, so you can control how many keys are generated for every object.
Please note that only local animations are exported, and not World Modifiers.
*************************************************************** - FREQUENTLY ASKED QUESTIONS - TOP***************************************************************
CASES OF MALFUNCTIONS OR TOTALLY MISSING RESULTS:
Q: 3ds Max doesn't let me use the plugin or the plugin doesn't work.
A: There are 2 different versions of the plugin: one for max1.x and one for max2.x; be sure that you're using the right one.
Q: I can't see the scene?
A: If you're using the gouraud-shading renderer (anfy3dg.class) you must use at least an omni-light that lits your scene. Otherwise you can use an ambient coeff inside the html different from 0. You can also try to use the flat renderer (anfy3df.class) and your scene will surely appear... If this is not enough, probably your objects are too big and are clipped by the "far_clip" parameter. In this case, increase the "far_clip" parameter and/or resize your scene to be smaller.
Q: I cannot apply a texture map on an object.
A: You must define a material inside 3dsmax and you must select a bitmap as the diffusion map inside the material properties. The plugin supports ONLY bitmap texture map and not procedural texture maps. Be also sure you've applied some kind of UVW mapping to your object. Actually only UV mapping is used.
Q: My scene works, but I can't see it working online. TOP
A: Remember that filenames in unix and internet are CASE SENSITIVE and that the files "pippo.jpg" and "PIPPO.jpg" or "pippo.JPG" are all different. The applet search for exact texture and scene names.
Q: My light doesn't illuminate anything?
A: If you want your light to illuminate be sure that the far radius is larger than the near radius (At least 1 unit). Otherwise your light is considered as a lightball and won't illuminate anything.
CASES OF IMPRECISE RENDERINGS:
Q: I have a really large scene and some far objects disappear when they're too far.
A: Just change the far_clip value to an higher value. Or you can also use the gouraud-shaded renderer (anfy3dg.class) and activate a fog, so your scene will fade away in distance.
Q: The animation is not equal to the one I created inside 3dsmax.
A: You have to add keys inside the trackview editor of max. You can also check the interpolate flag in the main interface of the plugin and try to put different values in the keys edit box near the 'interpolate' button. If you want a perfect animation just put there the number of frames that your animation is using.
Q: Some faces disappear and sometime the texture mapping is distorted.
A: To obtain fast rendering routines we decided not to use perspective corrected texture mapping. This can lead to a number of errors, but they can really easily worked around: just tesselate your polygons. Instead of using large one polygon faces, just use many little faces.. Everything will work better and without any problems. You can first make a scene with large polygons and then use the tesselate options inside 3dsmax.
Q: I can't morph an object into another.
A: Sorry but this version can't morph objects; but we're working on it... Check our site to see if something new has been released.
Q: Object are shown on the screen but they don't move.
A: Probably you're interpolating between keys that are at the same value; you can do 2 different things: the first one is to add some keys between the keys of the object that doesn't move; the other way is to use the 'interpolate' option with a good number of keys used (start from 10: if the animation is not good use an higher number, if animation is ok try a number that's smaller than the previous).