NeonJax 3D

NeonJax3D Example Scene Manual


Electronic Documentation for NeonJax3D Example Scenes

Version 1.0

July 9th, 2002

Copyright (c) 2002 by Richard Goedeken


A product of Fascination Software Co.


Legal Stuff:

This software (NeonJax3D SDK Version 1.0) is copyrighted software. I give you (the LICENSEE) permission to freely copy and distribute this software in any manner to anyone (the RECIPIENTS) as long as the following two conditions are met:

  1. The LICENSEE may not charge the RECIPIENTS more than us$1 over and above the media and duplication costs for copies of this software.
  2. Any copies made by the LICENSEE must retain all of the original files and the original file structure from the ZIP file distributed by Fascination Software. (NeonJax3D-SDK.zip)

Fascination Software, and Richard Goedeken, are not in any way liable for any damages incurred by the use of this software. The user assumes full responsibility for the use of this software.


TheScenes.txt

This file contains information regarding the usage of the example scenes included with NeonJax3D. There are 5 demo scenes included, which collectively demonstrate all of the features available on the NeonJax3D demo engine. These example scenes are described below.

The user may use any of the included example source code (Objects, Palettes, Paths, or Items) in his or her own NeonJax3D demos.


  Example_1.txt (Big Example World)

This example file contains the code for 8 3D Objects, 6 Palettes, and one Path. It also contains example code for using each of the 12 available Point Morph effects. There are only 3 Items used in this Scene (Diamond, SpikeStar, and Points) but the user may easily change these Items to different Objects to begin playing with the NeonJax3D World Compiler.


  Example_2.txt (Cubes)

This NeonJax3D example demo is composed entirely of cubes! There are two cube Items with two-tone palettes, and a Points object which alternates between the EmptyCube, FilledCube, and BouncingCubes effects.


  Example_3.txt (Snow Field)

This is a bare-bones example. It contains no Objects or Palettes, just a single Points Item which continuously displays the SnowField effect. The snow field is placed at a slight angle to the viewer to achieve the best viewing experience.


  Example_4.txt (Wandering Planets)

This is a small example of a possible solar system - it includes a star, and three planets orbiting around the sun. The Points object is set to the SaturnRings effect and is placed around the green planet.

This example file would serve as an excellent starting point for a true Solar System model demo.


  Example_5.txt (The Tori)

This example file includes two toroidal objects that were generated with the Torus3D.bas program (see the Torus3D.bas section for more information). These doughnut-shaped Objects are used with two unique palettes in this Scene. One palette is reflective purple and gold, while the other is 'glitchy'- looking and blue. This example file does not use the Points object.


Testing The Scenes

Your file/directory structure should be set up as described in the Readme.txt file in the root directory of this SDK. To test an example Scene file, just run the corresponding batch file from the command prompt or the Windows Explorer. For example, in order to test 'Example_5.txt', execute the 'Example_5_Compile.bat' program. This batch file will compile the Scene file (and pause if there was an error), then it will display the 'Example_5.J3D' demo using the DX3 version of the NeonJax3D Screen Saver.


Modifying The Scenes

You may use any text editor to modify the Example_*.txt files and test your modifications as described above. Refer to the NeonJax3D World Compiler Manual for detailed information about the NeonJax3D World Compiler and features available to the NeonJax3D Scene designer.


Torus3D.bas

There is a text file included in this directory with the Scene files called 'Torus3D.bas'. This is a QuickBasic 5.1 program which was used to generate the toroidal Objects in 'Example_5.txt'. Users may modify this program to easily create their own 3D objects.

The 'Torus3D.bas' program was designed to be compiled by Microsoft QuickBasic and run from the command line, piping the output to a text file like this: 'Torus3D.exe > TorusObjects.txt'. If the user does not have a Basic compiler but does have an interpreter (such as Basica or GWBasic), it should be easy to add the necessary code to 'Torus3D.bas' to output the Object data to a disk file instead of the screen.

The contents of the Torus3D.bas file are duplicated below:

REM 7/07/02
REM 3D Torus Model

REM set variables
Radial1Pts = 18
Radial2Pts = 37
Radius1 = 27
Radius2 = 142
CONST PI = 3.1415926535797#

REM calculate other parameters
Vertices = Radial1Pts * Radial2Pts
Polygons = 2 * Vertices

REM dimension arrays
DIM Vert(Vertices, 3)
DIM Poly(Polygons, 3)

CLS
PRINT "Radial 1 Points:"; Radial1Pts
PRINT "Radial 2 Points:"; Radial2Pts
PRINT "Vertices:"; Vertices
PRINT "Polygons:"; Polygons

REM calculate vertex positions
Idx = 0
FOR J = 1 TO Radial2Pts
  FOR I = 1 TO Radial1Pts
    REM First put it on a circle in the X-Z plane
    Rad1 = 2 * PI * (I - 1) / Radial1Pts
    VertX = Radius1 * COS(Rad1) + Radius2
    VertZ = -Radius1 * SIN(Rad1)
    REM Then twirl the circle into a torus
    MyRadius = VertX
    Rad2 = 2 * PI * (J - 1) / Radial2Pts
    VertX = MyRadius * COS(Rad2)
    VertY = -MyRadius * SIN(Rad2)
    REM store this vertex
    Vert(Idx, 0) = VertX
    Vert(Idx, 1) = VertY
    Vert(Idx, 2) = VertZ
    Idx = Idx + 1
  NEXT I
NEXT J

REM Now do the polys
Idx = 0
PolyIdx = 0
FOR J = 1 TO Radial2Pts
   FOR I = 1 TO Radial1Pts
     REM calculate corner positions
     IdxSE = Idx: Idx = Idx + 1
     IF I = Radial1Pts THEN
       IdxSW = IdxSE - (Radial1Pts - 1)
       ELSE
       IdxSW = IdxSE + 1
       END IF
     IF J = Radial2Pts THEN
       IdxNE = I - 1
       ELSE
       IdxNE = IdxSE + Radial1Pts
       END IF
     IF I = Radial1Pts THEN
       IdxNW = IdxNE - (Radial1Pts - 1)
       ELSE
       IdxNW = IdxNE + 1
       END IF
     REM save the polys (define vertices in counter-clockwise order)
     Poly(PolyIdx, 0) = IdxNE
     Poly(PolyIdx, 1) = IdxNW
     Poly(PolyIdx, 2) = IdxSE
     PolyIdx = PolyIdx + 1
     Poly(PolyIdx, 0) = IdxSW
     Poly(PolyIdx, 1) = IdxSE
     Poly(PolyIdx, 2) = IdxNW
     PolyIdx = PolyIdx + 1
   NEXT I
NEXT J

REM dump out the vertices
FOR I = 0 TO Vertices - 1
   I0 = INT(I / 26)
   I1 = I - (I0 * 26)
   IF I<26 THEN NAME$ = CHR$(I+65) ELSE NAME$ = CHR$(I0+64)+CHR$(I1+65)
   IF Vert(I, 0)<0 THEN VX = INT(Vert(I, 0)) ELSE VX = INT(Vert(I, 0) + .5)
   IF Vert(I, 1)<0 THEN VY = INT(Vert(I, 1)) ELSE VY = INT(Vert(I, 1) + .5)
   IF Vert(I, 2)<0 THEN VZ = INT(Vert(I, 2)) ELSE VZ = INT(Vert(I, 2) + .5)
   IF VX < 0 THEN VX$ = STR$(VX) ELSE VX$ = MID$(STR$(VX), 2)
   IF VY < 0 THEN VY$ = STR$(VY) ELSE VY$ = MID$(STR$(VY), 2)
   IF VZ < 0 THEN VZ$ = STR$(VZ) ELSE VZ$ = MID$(STR$(VZ), 2)
   IF I - (3 * INT(I / 3)) = 0 THEN PRINT " ";
   PRINT "Vertex "; NAME$; " ("; VX$; ","; VY$; ","; VZ$; "); ";
   IF I - (3 * INT(I / 3)) = 2 THEN PRINT
NEXT I

REM dump out the polygons
FOR I = 0 TO Polygons - 1
   Va = Poly(I, 0)
   Vb = Poly(I, 1)
   Vc = Poly(I, 2)
   I0 = INT(Va / 26): I1 = Va - (I0 * 26)
   IF Va<26 THEN NameA$ = CHR$(Va+65) ELSE NameA$ = CHR$(I0+64)+CHR$(I1+65)
   I0 = INT(Vb / 26): I1 = Vb - (I0 * 26)
   IF Vb<26 THEN NameB$ = CHR$(Vb+65) ELSE NameB$ = CHR$(I0+64)+CHR$(I1+65)
   I0 = INT(Vc / 26): I1 = Vc - (I0 * 26)
   IF Vc<26 THEN NameC$ = CHR$(Vc+65) ELSE NameC$ = CHR$(I0+64)+CHR$(I1+65)
   IF I - (4 * INT(I / 4)) = 0 THEN PRINT " ";
   P = INT(I / 2)
   IF P / Radial1Pts = INT(P / Radial1Pts) OR P - Radial1Pts * INT(P / Radial1Pts) = INT(Radial1Pts / 2) THEN
     A$ = ") NeonGreen; "
     ELSE
     A$ = "); "
     END IF
   PRINT "Poly ("; NameA$; ","; NameB$; ","; NameC$; A$;
   IF I - (4 * INT(I / 4)) = 3 THEN PRINT
NEXT I


Back

Software
FS Home Page