home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / CHIP_4_98.ISO / Java / applet / tmapcube / tmapcube.txt < prev    next >
Encoding:
Text File  |  1998-02-21  |  14.4 KB  |  322 lines

  1.  
  2.     Anfy Texturemapped 3d Cube 2.2 - Copyright (C) by Fabio Ciucci 1997/98
  3.  
  4.  
  5. This applet can map on the faces of a cube any GIF/JPG image, used as
  6. texture. Greetings to Aceman/RJ and Klorathy/RJ for coding help.
  7. Remember that are needed both TmapCube.class , Lware.class and anfy.class.
  8. You must upload these 3 .class files and insert the <applet> tag on your
  9. html document to add this applet to your page.
  10. This applet is fully parametrized, so you can change the size and movements
  11. of the cube. Here an example of what you have to write in the html (the
  12. things anfter the ; are comments with min-max values acceptet):
  13.  
  14. <applet code="TmapCube.class" width=188 height=188> ; Name, Width, Height
  15. <param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
  16. <param name=regcode value="NO">         ; Register code (if you have it)
  17. <param name=reglink value="NO">         ; URL where go optionally when clicked
  18. <param name=regnewframe value="YES">    ; Reglink opened in new frame?
  19. <param name=regframename value="_blank"> ; Name of new frame for reglink
  20. <param name=statusmsg value="Tmapcube applet">  ; Statusbar message
  21. <param name=res value="1">              ; Resolution (1 .. 8)
  22. <param name=image1 value="face1.gif">   ; Image 1 to load
  23. <param name=image2 value="face1.jpg">   ; Image 2 to load
  24. <param name=image3 value="face2.gif">   ; Image 3 to load
  25. <param name=image4 value="face2.jpg">   ; Image 4 to load
  26. <param name=image5 value="face3.jpg">   ; Image 5 to load
  27. <param name=image6 value="face3.jpg">   ; Image 6 to load
  28. <param name=interactive value="YES">    ; Interactive mode ("YES" - "NO")
  29. <param name=lightsourced value="YES">   ; Lightning ("YES" - "NO")
  30. <param name=rotx value="4">             ; X Rotation speed
  31. <param name=roty value="6">             ; Y Rotation speed
  32. <param name=rotz value="8">             ; Z Rotation speed
  33. <param name=backimage value="NO">       ; Optional background image
  34. <param name=backr value="64">           ; Red in background (0 .. 255)
  35. <param name=backg value="96">           ; Green in background (0 .. 255)
  36. <param name=backb value="160">          ; Blue in background (0 .. 255)
  37. <param name=clearback value="YES">      ; Clear the background ("YES" - "NO")
  38. <param name=textscroll value="tcubescr.txt"> ; File for scrolltext or "NO"
  39. <param name=textoffset value="140">          ; Txtscroll y offset
  40. <param name=textspeed value="1">          ; Txtscroll speed
  41. <param name=textfont value="Arial">       ; Txtscroll font name
  42. <param name=textbold value="NO">          ; Txtscroll bold ("YES" or "NO")
  43. <param name=textsize value="24">          ; Txtscroll font size
  44. <param name=textshadow value="YES">       ; Txtscroll shadow ("YES" or "NO")
  45. <param name=TextColR value="200">         ; Txtscroll color (red component)
  46. <param name=TextColG value="255">         ; Txtscroll color (green component)
  47. <param name=TextColB value="190">         ; Txtscroll color (blue component)
  48. <param name=TextSColR value="20">         ; Txtscroll shadow col. (red c.)
  49. <param name=TextSColG value="20">         ; Txtscroll shadow col. (green c.)
  50. <param name=TextSColB value="50">         ; Txtscroll shadow col. (blue c.)
  51. <param name=TextJumpAmp value="0">        ; Txtscroll jump aplitude
  52. <param name=TextJumpSpd value="0">        ; Txtscroll jump speed
  53. <param name=TextSineAmp value="0">        ; Txtscroll sineshape amplitude        
  54. <param name=TextSineSpd value="0">        ; Txtscroll sineshape movement
  55. <param name=TextSineAngle value="0">      ; Txtscroll sineangle / pixel  
  56. <param name=memdelay value="1000">        ; Memory deallocation delay
  57. <param name=priorityL value="3">          ; Loading task priority (1..10)
  58. <param name=priority value="3">           ; Task priority (1..10)
  59. <param name=MinSYNC value="10">           ; Min. milliseconds/frame for sync
  60. Sorry, your browser doesn't suppor Java.  ; Message for no java browsers.
  61. </applet>                                 ; End of applet tag
  62.  
  63.  
  64. NOTE: Don't place "; comments" on final HTML!!!
  65.  
  66. Copy and paste in your html document this cleared and correct tag,
  67. Then, change the images and other parameters:
  68.  
  69.  
  70. <applet code="TmapCube.class" width=188 height=188>
  71. <param name=credits value="Applet by Fabio Ciucci (www.anfiteatro.it/java.html)">
  72. <param name=regcode value="NO">
  73. <param name=reglink value="NO">
  74. <param name=regnewframe value="YES">
  75. <param name=regframename value="_blank">
  76. <param name=statusmsg value="Tmapcube applet">
  77. <param name=res value="1">
  78. <param name=image1 value="face1.gif">
  79. <param name=image2 value="face1.gif">
  80. <param name=image3 value="face2.jpg">
  81. <param name=image4 value="face2.jpg">
  82. <param name=image5 value="face3.jpg">
  83. <param name=image6 value="face3.jpg">
  84. <param name=interactive value="YES">
  85. <param name=lightsourced value="YES">
  86. <param name=rotx value="4">
  87. <param name=roty value="6">
  88. <param name=rotz value="8">
  89. <param name=backimage value="NO">
  90. <param name=backr value="64">
  91. <param name=backg value="96">
  92. <param name=backb value="160">
  93. <param name=clearback value="YES">
  94. <param name=textscroll value="tcubescr.txt">
  95. <param name=textoffset value="180">
  96. <param name=textspeed value="1">
  97. <param name=textfont value="Arial">
  98. <param name=textbold value="NO">
  99. <param name=textsize value="24">
  100. <param name=textshadow value="YES">
  101. <param name=TextColR value="255">
  102. <param name=TextColG value="235">
  103. <param name=TextColB value="100">
  104. <param name=TextSColR value="20">
  105. <param name=TextSColG value="20">
  106. <param name=TextSColB value="50">
  107. <param name=TextJumpAmp value="0">
  108. <param name=TextJumpSpd value="0">
  109. <param name=TextSineAmp value="0">
  110. <param name=TextSineSpd value="0">
  111. <param name=TextSineAngle value="0">
  112. <param name=memdelay value="1000">
  113. <param name=priorityL value="3">
  114. <param name=priority value="3">
  115. <param name=MinSYNC value="10">
  116. Sorry, your browser doesn't suppor Java.
  117. </applet>
  118.  
  119.  
  120.                              ---------
  121.  
  122.  
  123. Here detailed instructions about how to change parameters:
  124.  
  125. The credits parameter can't be changed otherwise the applet will not work.
  126.  
  127. To activate the reg parameters read the shareware registration notes.
  128. In the "regcode" parameter you have to place the registration code you
  129. purchase from the author. If it is correct and the applet is run from the
  130. registered domain name, you can use "reglink" parameter, where you can specify
  131. an URL where bring user when the applet is clicked.
  132. If you set to "YES" regnewframe, you can specify a frame where load the
  133. reglink:
  134.  
  135. "_blank"  : To load the link in a new blank unnamed browser window.
  136. "_self"   : To load the link into the same window the applet occupies.
  137. "_parent" : To load the link into the immediate FRAMESET parent.
  138. "_top"    : To load the link into the top body of the window.
  139.  
  140. Otherwise the frame name, for example "myframe1".
  141.  
  142. You can load up to 6 different images to map on the faces of cube.
  143. If you place same image name on all 6 image parameters, all faces will
  144. display same image, otherwise you can display 2, 3, 4, 5, 6 different
  145. images. The best choices are 3 and 6, because with 3 different images
  146. palced in the same order of the example below, you will see no duplicate
  147. images in same frame, but you have to load 3 only images.
  148. If you want to fill all the faces with a different image, you can do it,
  149. but consider loading time will increase.
  150. The GIF/JPG images MUST be all 256*256 pixels large, otherwise ALL 128*128.
  151. No other sizes are allowed, and notice you can't mix 128*128 images with
  152. 256*256 images in same cube applet. Or ALL 128*128 or ALL 256*256.
  153. Using 256*256 images is useful only when applet size is greater than 150.
  154. You can mix GIF and JPG formats in same cube; what you can't mix is image
  155. size.
  156.  
  157. Res is a sort of fine resolution. Res=1 mean normal pixel size, res=2 mean
  158. doubled pixels etc.
  159. With res = 1 the image is better but slower, with res = 2 or 3 the speed is
  160. increased but image quality is less.
  161.  
  162. You can activate or deactivate the interactive mode with "interactive"
  163. parameter: if set to "YES", user can control cube movements with mouse.
  164.  
  165. Setting the "lightsourced" parameter to "YES" you will enable the phong
  166. lightsourcing; setting it to "NO" any shading will be displayed.
  167.  
  168. With the "rotx", "roty" and "rotz" parameters you can control the rotation
  169. speed of the cube.
  170.  
  171. With "backr", "backg" and "backb" parameters you can control the RED, GREEN
  172. and BLUE components of the background color.
  173.  
  174. You can load optionally a background image, placing it's name on the
  175. "backimage" parameter. This image must be same size as the aplet if res=1,
  176. otherwise is res=2, must be half size of the applet, and so on.
  177.  
  178. You can disable the background clear routine setting "NO" to "clearback"
  179. parameter, if you like.
  180.  
  181.  
  182.                              ---------
  183.  
  184.  
  185. Optional Scrolltext parameters:
  186.  
  187.  
  188. You can optionally activate a scrolltext that will scroll over the applet.
  189. If you don't need the scrolltext, deactivate it placing "NO" at the
  190. "textscroll" parameter.
  191. Otherwise you must supply the name of an ASCII text file, where you must
  192. write the text that you want to be scrolled.
  193. Is supported one only line of text, that can be long as you want.
  194. Remember to upload the text file too, if you activate the scrolltext!
  195.  
  196. If activated, here are the parameters:
  197.  
  198. With "textoffset" you choose the Y offset from the top: placing it to 0 the
  199. scroll will be placed on the top, for example, and placing a value near the
  200. height of the applet it will scroll at the bottom.
  201.  
  202. With "textspeed" parameter you decide the scrolling speed.
  203.  
  204. With "textfont" you choose the font of text. Don't choose a strange or not
  205. standard font, not present in all systems.
  206. The most common fonts are "Arial", "TimesRoman" and "Courier".
  207. If the required font is not present, the most "near" will be used.
  208.  
  209. Setting "textbold" to "YES" you will enlarge a bit the font, otherwise set
  210. it to "NO" for normal contours.
  211.  
  212. With "textsize" you can change the size of text font.
  213. The most common sizes are: 8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72.
  214. Intermediate values will be scaled to nearest available size.
  215.  
  216. Setting "textshadow" to "YES", a shadow will be added to textscroll.
  217. Otherwise, setting it to "NO", any shadow will be "projected".
  218.  
  219. You can choose the color of text with:
  220.  
  221. TextColR = Red component of color (0-255)
  222. TextColG = Green component of color (0-255)
  223. TextColB = Blue component of color (0-255)
  224.  
  225. For example, 0,0,0 is black, 255,255,255 is white, 255,0,0 is red,
  226. 255,255,0 is yellow, 128,128,128 is grey.
  227. You can compose any color you want, do it trying manually or use any paint
  228. program's color selector to find Red Green Blue components of your desired
  229. colors.
  230.  
  231. With TextSColR,TextSColG,TextSColB you can select the color for text shadow.
  232.  
  233. If you like, you can activate the text jumping function.
  234. If "TextJumpAmp" is set to "0", any jumping will be shown.
  235. But increasing the value will result in text jumping: more aplitute, more
  236. high jumps.
  237.  
  238. With "TextJumpSpd" parameter you can select the jumping speed.
  239.  
  240. If you like, you can also activate the sine scroll function.
  241. If "TextSineAmp" is set to 0, no sine distortion will be generated.
  242. But increasing the value will result in the that the text is waving. The
  243. higher amplitude, the more waving.
  244.  
  245. With the "TextSineSpd" parameter you can select the speed of the wave.
  246.  
  247. With the "TextSineAngle" parameter you control how many degrees in a sinewave
  248. shape the text will be deformed for each pixel. A higher value gives more
  249. distortion.
  250.  
  251.                              ---------
  252.  
  253.  
  254. Compatibility parameters:
  255.  
  256.  
  257. The "memdelay" parameter is useful only to run the applets without problems
  258. on some bugged versions of Netscape 3, that don't deallocate correctly
  259. the memory allocated, resulting in filling all the memory after a minute
  260. the applet is running. This can cause also a system crash in some cases.
  261. Last versions of browsers have fixed this problem, but if you want to run
  262. the applets on old bugged browsers too, set "memdelay" to low values, like
  263. "10" or "16", for example.
  264. But this will slow down a lot the applet speed, so you have to choose
  265. between speed (memdelay set to 1000 or higher) or slow compatibility with
  266. old browsers (memdelay set to 20 or lower).
  267.  
  268. The "priority" parameter is useful mainly when you are running more than
  269. one applet in same page, and one slows down or hangs.
  270. If this applet run too slow or hangs because other one steal all the CPU
  271. power, try increasing the priority.
  272. Otherwise, if this applet runs well and others slows down, decrease the
  273. priority. Consider the min priority is 1, normal priority is 5, and the
  274. max priority is 10. Usually a priority of 3 is ok for single applets.
  275.  
  276. The "priorityL" parameter is the priority when loading images.
  277.  
  278. The "MinSYNC" parameter must be set to a value between 8 and 16 to slow
  279. down animation in the case it runs too faster on faster computers or because
  280. the applet size is very small. The optimal value seems to be 10, but you can
  281. disable this feature placing a value of 0 if you see flickerings or excessive
  282. slow down.
  283. If the applets steal 100% of CPU power or slows down the browser and Operating
  284. System, try increasing MinSYNC until all runs ok.
  285. Usually values between 40 and 400 fixes all problems, even if applet slows
  286. down for compatibility.
  287.  
  288.                              ---------
  289.  
  290.  
  291. Copyright and distribution notices
  292.  
  293.  
  294. Fabio Ciucci is the author and owner of this applet.
  295. You can use freely this applet to enhance your web pages. But since I am
  296. the author of the applet, I placed a secret linkware window that will appear
  297. if the applet is clicked with mouse, only when the applet is online on a site:
  298. it is external to the web browser, so it will not hit the design of your
  299. beautyful html page.
  300. This small window will simply show my name and ask for a link to my java
  301. applets page.. the user can connect to it or cancel, or hide the window and
  302. connect after visiting all your pages.
  303. I hope this credit part is not a problem for you...
  304. In any case, if link is accepted a new browser window will appear and your
  305. page will remain on the original window, so you will not lost the visitor.
  306. Consider you will use an effect programmed by me, without pay, for FREE!
  307.  
  308. NOTE: You can include the applets archive on CD-ROMS or shareware collections
  309. and shareware sites without ask me, but only if you leave the archive(s)
  310. unchanged.
  311.  
  312.                              ---------
  313.  
  314.  
  315. Fabio Ciucci (Randy/Ram Jam)
  316.  
  317. fabioc@anfiteatro.it
  318.  
  319. http://www.anfiteatro.it/java.html
  320.  
  321.  
  322.