a3dAPI
Class a3dCORE

java.lang.Object
  |
  +--a3dAPI.a3dCORE
All Implemented Interfaces:
anfy3dAPI

public class a3dCORE
extends java.lang.Object
implements anfy3dAPI

This class implements all anfy3dAPI core functions. It's also used to initialize a device driver

Author:
Andrea Fasce

Constructor Summary
a3dCORE(java.lang.String driver)
          Creates a new a3dCORE rendering system
 
Method Summary
 int addChild(int ID, int childID)
          adds a child item (it may be a Light, a Mesh or a Transform) to a Transform
 void beginScene()
          beginning of a scene modifies.
 void clearScene()
          clears all the items contained inside a scene.
 int createCamera()
          Create a new default Camera
 int createLightDirectional()
          create a new default Directional light
 int createLightOmni()
          create a new default Omni light
 int createMaterial()
          create a new default material with diffuse(0,0,0) emissive(0,0,0) transparency(0)
 int createMesh(float[] vertex, int[] vertexI, float[] color, int[] colorI, float[] map0, int[] map0I, float[] normal, int[] normalI, int[] material, int[] texture)
          create a new Mesh
 int createTexture()
          create a new default (null) Texture
 int createTransform()
          create a unit transformation
 void delete(int ID)
          delete an item from memory.
 void endScene()
          ends of a scene modifies (and also renders)
 java.lang.String getAuthor()
          returns the author of the engine
 java.awt.Component getComponent()
          return the Component object that will be used for rendering.
 float[] getMeshNormalTransformed(int ID, int subID)
          gets the rotated array of normals.
 float[] getMeshVertexTransformed(int ID, int subID)
          gets the rotated array of vertices.
 java.lang.String getSystem()
          returns the subsystem of the engine
 java.lang.String getVersion()
          returns the version of the engine
 int[][][] grow(int[][][] start)
           
 int pick(float x, float y, float z, float nx, float ny, float nz, float[] info, int[] matInfo, float[] texInfo, float[] normalInfo)
          picks the object that intersect a ray.
 int pick(int mousex, int mousey, float[] info, int[] matInfo, float[] texInfo, float[] normalInfo)
          picks the object that is under the mouse
 void remChild(int ID, int childID)
          remove a child item from a Transform
 void render()
          renders a scene.
 void setAmbientColor(float r, float g, float b)
          set ambient light color (default is 0 0 0)
 void setBackgroundColor(float r, float g, float b)
          set the color of the background
 void setBackgroundImage(int[] pix, int width, int height)
          set as background an Image.
 void setBilinear(boolean bilinear)
          sets bilinear filtering on and off for all the scene
 void setCameraFov(int ID, float fov)
          set the fov (field of view) of a Camera (the fov should be int the interval (0,179] (default is 48)
 void setCameraLookAt(int ID, float lx, float ly, float lz, float upx, float upy, float upz)
          set the orientation of a Camera
 void setCameraMatrix(int ID, float[] m)
          set the camera transformation directly
 void setCameraOrientation(int ID, float x, float y, float z, float w)
          set the orientation of a Camera (default is 0,0,1,0)
 void setCameraPlanes(int ID, float near, float far)
          set the near and far planes of a Camera (default near is 0.1 and far is +infinite)
 void setCameraPosition(int ID, float x, float y, float z)
          set the position of a Camera (default is 0,0,10)
 void setFilter(int filter)
          sets a post-processing filter
 void setFogActive(boolean flag)
          switch fog on/off
 void setFogLinear(float near, float far, float r, float g, float b)
          set fog parameters
 void setKeyCode(java.lang.String key)
          sets the keyCode to register this engine
 void setLightActive(int ID, boolean flag)
          switch on/off a Light
 void setLightAttenuation(int ID, float x, float y, float z)
          set the attenuation of an Omni Light; as attenuation formula is used: atten = 1/max(a+b*d+c*d*d,1) where d is the distance of a point from the light
 void setLightColor(int ID, float r, float g, float b)
          set the color of a Light
 void setLightDirection(int ID, float x, float y, float z)
          set the direction of a Directional Light
 void setLightIntensity(int ID, float i)
          set the intensity of a Light
 void setLightPosition(int ID, float x, float y, float z)
          set the position of an Omni Light
 void setLightRadius(int ID, float r)
          set the radius of illumination of an Omni Light
 void setMaterialDiffuse(int ID, float r, float g, float b)
          set the diffuse color of a Material
 void setMaterialEmissive(int ID, float r, float g, float b)
          set the emissive color of a Material
 void setMaterialTransparency(int ID, float n)
          set the transparency of a Material
 void setMeshActive(int ID, boolean flag)
          switch on/off a Mesh
 void setMeshColor(int ID, float[] color)
          change the vertex colors of a Mesh
 void setMeshMap(int ID, float[] map)
          change the mapping coords of a Mesh
 void setMeshMaterial(int ID, int matID)
          set the Material of a Mesh
 void setMeshNormal(int ID, float[] normal)
          change the normals of a Mesh
 void setMeshTexture(int ID, int texID)
          set the Texture of a Mesh
 void setMeshVertex(int ID, float[] vertex)
          change the vertices of a Mesh (useful for morphing etc)
 void setSceneCamera(int ID)
          set the active Camera for the scene
 void setSceneRoot(int ID)
          set the root Transform for the scene
 void setTextureBilinear(int ID, boolean bilinear)
          set bilinear filtering for a texture
 void setTextureImage(int ID, int[] pix, int width, int height)
          set the new image for a Texture
 void setTransformMatrix(int ID, float[] matrix)
          set the 3x4 affine transformation matrix of a Transform item
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

a3dCORE

public a3dCORE(java.lang.String driver)
Creates a new a3dCORE rendering system
Parameters:
driver - the driver that you want to initialize. Driver can be: "software" - for the standard software driver "software-swzoom" - for a software drivers that offers software zooming "software-jzoom" - for a software drivers that offers zooming through java awt functions "software-antialias" - for a software driver that supports true per-pixel antialiasing "hardware-gl4j" - for an hardware driver that uses gl4java Please note that if the hardware driver cannot be instantiated (for example becouse you didn't installed gl4java) then the render will automatically switch to the software mode. Also consider that if you don't use hw acceleration you can remove the class a3dGL4J.class from the distribution and save some kb
Method Detail

getVersion

public java.lang.String getVersion()
Description copied from interface: anfy3dAPI
returns the version of the engine
Specified by:
getVersion in interface anfy3dAPI

getAuthor

public java.lang.String getAuthor()
Description copied from interface: anfy3dAPI
returns the author of the engine
Specified by:
getAuthor in interface anfy3dAPI

getSystem

public java.lang.String getSystem()
Description copied from interface: anfy3dAPI
returns the subsystem of the engine
Specified by:
getSystem in interface anfy3dAPI

setBackgroundColor

public final void setBackgroundColor(float r,
                                     float g,
                                     float b)
Description copied from interface: anfy3dAPI
set the color of the background
Specified by:
setBackgroundColor in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
r - red component
g - green component
b - blue component

setBackgroundImage

public final void setBackgroundImage(int[] pix,
                                     int width,
                                     int height)
Description copied from interface: anfy3dAPI
set as background an Image. Image is automatically stretched to fit the size of the screen
Specified by:
setBackgroundImage in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
pix - an array containing a argb image (alpha is used !)
width - width of the image
height - height of the image

setTextureImage

public void setTextureImage(int ID,
                            int[] pix,
                            int width,
                            int height)
Description copied from interface: anfy3dAPI
set the new image for a Texture
Specified by:
setTextureImage in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Texture
pix - an array of data in format ARGB
width - width of the image
height - height of the image

setBilinear

public void setBilinear(boolean bilinear)
Description copied from interface: anfy3dAPI
sets bilinear filtering on and off for all the scene
Specified by:
setBilinear in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
bilinear - true to switch bilinear filtering on

beginScene

public void beginScene()
Description copied from interface: anfy3dAPI
beginning of a scene modifies. All changes of a scene MUST be done inside a beginScene()/endScene()
Specified by:
beginScene in interface anfy3dAPI

endScene

public void endScene()
Description copied from interface: anfy3dAPI
ends of a scene modifies (and also renders)
Specified by:
endScene in interface anfy3dAPI

setFilter

public void setFilter(int filter)
Description copied from interface: anfy3dAPI
sets a post-processing filter
Specified by:
setFilter in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
filter - can be: 0-none 1-antialias 2-blurmotion

getComponent

public java.awt.Component getComponent()
Description copied from interface: anfy3dAPI
return the Component object that will be used for rendering. Consider that you can cast this component object to a driver type if you want to access extended (ext functions) example: a3dSWH softwareEngine = (a3dSWH)a3dCore.getComponent())
Specified by:
getComponent in interface anfy3dAPI

setKeyCode

public void setKeyCode(java.lang.String key)
Description copied from interface: anfy3dAPI
sets the keyCode to register this engine
Specified by:
setKeyCode in interface anfy3dAPI

setFogActive

public void setFogActive(boolean flag)
Description copied from interface: anfy3dAPI
switch fog on/off
Specified by:
setFogActive in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
flag - true-fog on, false-fog off

setFogLinear

public void setFogLinear(float near,
                         float far,
                         float r,
                         float g,
                         float b)
Description copied from interface: anfy3dAPI
set fog parameters
Specified by:
setFogLinear in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
type - 0-linear fog 1-exponential fog
near - near fog plane
far - far fog plane
r - fog r color
g - fog g color
b - fog b color

setAmbientColor

public void setAmbientColor(float r,
                            float g,
                            float b)
Description copied from interface: anfy3dAPI
set ambient light color (default is 0 0 0)
Specified by:
setAmbientColor in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
r - red ambient component
g - green ambient component
b - blue ambient component

createTransform

public final int createTransform()
Description copied from interface: anfy3dAPI
create a unit transformation
Specified by:
createTransform in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID that identify the transformation

createMaterial

public final int createMaterial()
Description copied from interface: anfy3dAPI
create a new default material with diffuse(0,0,0) emissive(0,0,0) transparency(0)
Specified by:
createMaterial in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID of the new material

createMesh

public final int createMesh(float[] vertex,
                            int[] vertexI,
                            float[] color,
                            int[] colorI,
                            float[] map0,
                            int[] map0I,
                            float[] normal,
                            int[] normalI,
                            int[] material,
                            int[] texture)
Description copied from interface: anfy3dAPI
create a new Mesh
Specified by:
createMesh in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
vertex - an array containing all the vertices in (x,y,z) format
vertexI - an array containing the vertexIndices in the format (p0,p1,p2) to connect the faces. Faces are always triangules
color - an array containing the colors in (r,g,b) format. If null every vertex will has the color of the material for that face
colorI - an array containing informations for the color of every vertex of a face. The length of this array must be the same of the vertexI array. If null the vertexI array will be used
map0 - an array containing the mappings in (u,v) format. If null no texturemapping will be used
map0I - an array containing informations for the mapping of every vertex of a face. The length of this array must be the same of the vertexI array. If null the vertexI array will be used
normal - an array containing the normals in (nx,ny,nz) format. If null no normals will be used (and no illumination will be performed)
normalI - an array containing informations for the normal of every vertex of a face. The length of this array must be the same of the vertexI array. If null the vertexI array will be used
materialI - an array containing information for the material to use for every face. Every entry of this array MUST be a valid Material ID. If an entry is -1 no material will be used
textureI - an array containing information for the texture to use for every face. If an entry is -1 no texture will be used
Returns:
the ID of the new Mesh

createCamera

public final int createCamera()
Description copied from interface: anfy3dAPI
Create a new default Camera
Specified by:
createCamera in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID of the new Camera

createLightOmni

public final int createLightOmni()
Description copied from interface: anfy3dAPI
create a new default Omni light
Specified by:
createLightOmni in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID of the new light

createLightDirectional

public final int createLightDirectional()
Description copied from interface: anfy3dAPI
create a new default Directional light
Specified by:
createLightDirectional in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID of the new light

createTexture

public final int createTexture()
Description copied from interface: anfy3dAPI
create a new default (null) Texture
Specified by:
createTexture in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Returns:
the ID of the new Texture

setTransformMatrix

public final void setTransformMatrix(int ID,
                                     float[] matrix)
Description copied from interface: anfy3dAPI
set the 3x4 affine transformation matrix of a Transform item
Specified by:
setTransformMatrix in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Transform item to modify
matrix - the new 4x3 affine matrix that will be used for that Transform

addChild

public final int addChild(int ID,
                          int childID)
Description copied from interface: anfy3dAPI
adds a child item (it may be a Light, a Mesh or a Transform) to a Transform
Specified by:
addChild in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the parent Transform
childID - the ID of the child item
Returns:
the subID of the added object (useful when using multiple instances)

remChild

public final void remChild(int ID,
                           int childID)
Description copied from interface: anfy3dAPI
remove a child item from a Transform
Specified by:
remChild in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the parent Transform
childID - the ID of the child item

setMaterialDiffuse

public final void setMaterialDiffuse(int ID,
                                     float r,
                                     float g,
                                     float b)
Description copied from interface: anfy3dAPI
set the diffuse color of a Material
Specified by:
setMaterialDiffuse in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Material
r - red component
g - green component
b - blue component

setMaterialEmissive

public final void setMaterialEmissive(int ID,
                                      float r,
                                      float g,
                                      float b)
Description copied from interface: anfy3dAPI
set the emissive color of a Material
Specified by:
setMaterialEmissive in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Material
r - red component
g - green component
b - blue component

setMaterialTransparency

public final void setMaterialTransparency(int ID,
                                          float n)
Description copied from interface: anfy3dAPI
set the transparency of a Material
Specified by:
setMaterialTransparency in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Material
n - the transparency (range 0.0-1.0)

setTextureBilinear

public void setTextureBilinear(int ID,
                               boolean bilinear)
Description copied from interface: anfy3dAPI
set bilinear filtering for a texture
Specified by:
setTextureBilinear in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Texture
bilinear - true/false to switch bilinear on/off

setMeshActive

public final void setMeshActive(int ID,
                                boolean flag)
Description copied from interface: anfy3dAPI
switch on/off a Mesh
Specified by:
setMeshActive in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
flag - true-visible, false-invisible

setMeshMaterial

public final void setMeshMaterial(int ID,
                                  int matID)
Description copied from interface: anfy3dAPI
set the Material of a Mesh
Specified by:
setMeshMaterial in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
matID - the ID of the Material or -1 to switch off illumination for that mesh

setMeshTexture

public final void setMeshTexture(int ID,
                                 int texID)
Description copied from interface: anfy3dAPI
set the Texture of a Mesh
Specified by:
setMeshTexture in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
texID - the ID of the Texture or -1 to switch texture off for the Mesh

setMeshVertex

public final void setMeshVertex(int ID,
                                float[] vertex)
Description copied from interface: anfy3dAPI
change the vertices of a Mesh (useful for morphing etc)
Specified by:
setMeshVertex in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
vertex - an array of float that will replace the old vertex list; the length of this array should be the same length of the original vertex array

setMeshColor

public final void setMeshColor(int ID,
                               float[] color)
Description copied from interface: anfy3dAPI
change the vertex colors of a Mesh
Specified by:
setMeshColor in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
color - an array of float that will replace the old color list; the length of this array should be the same length of the original color array

setMeshNormal

public final void setMeshNormal(int ID,
                                float[] normal)
Description copied from interface: anfy3dAPI
change the normals of a Mesh
Specified by:
setMeshNormal in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
normal - an array of float that will replace the old normal list; the length of this array should be the same length of the original normal array

setMeshMap

public final void setMeshMap(int ID,
                             float[] map)
Description copied from interface: anfy3dAPI
change the mapping coords of a Mesh
Specified by:
setMeshMap in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
map - an array of float that will replace the old mapping coords list; the length of this array should be the same length of the original array

getMeshNormalTransformed

public final float[] getMeshNormalTransformed(int ID,
                                              int subID)
Description copied from interface: anfy3dAPI
gets the rotated array of normals. The normals are in camera space coords
Specified by:
getMeshNormalTransformed in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
subID - the subID of the instance of the Mesh (returned by addChild)
Returns:
an array of normals

getMeshVertexTransformed

public final float[] getMeshVertexTransformed(int ID,
                                              int subID)
Description copied from interface: anfy3dAPI
gets the rotated array of vertices. The vertices are in camera space coords
Specified by:
getMeshVertexTransformed in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Mesh
subID - the subID of the instance of the Mesh (returned by addChild)
Returns:
an array of vertices

setCameraOrientation

public final void setCameraOrientation(int ID,
                                       float x,
                                       float y,
                                       float z,
                                       float w)
Description copied from interface: anfy3dAPI
set the orientation of a Camera (default is 0,0,1,0)
Specified by:
setCameraOrientation in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
x - x component of axis
y - y component of axis
z - z component of axis
w - angle

setCameraLookAt

public final void setCameraLookAt(int ID,
                                  float lx,
                                  float ly,
                                  float lz,
                                  float upx,
                                  float upy,
                                  float upz)
Description copied from interface: anfy3dAPI
set the orientation of a Camera
Specified by:
setCameraLookAt in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
lx - x component of LookAt vector
ly - y component of LookAt vector
lz - z component of LookAt vector
upx - x component of Up vector
upy - y component of Up vector
upz - z component of Up vector

setCameraFov

public final void setCameraFov(int ID,
                               float fov)
Description copied from interface: anfy3dAPI
set the fov (field of view) of a Camera (the fov should be int the interval (0,179] (default is 48)
Specified by:
setCameraFov in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
fov - the fov expressed in degrees

setCameraPlanes

public final void setCameraPlanes(int ID,
                                  float near,
                                  float far)
Description copied from interface: anfy3dAPI
set the near and far planes of a Camera (default near is 0.1 and far is +infinite)
Specified by:
setCameraPlanes in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
near - the near plane (must be greater that 0)
far - the far plane (must be greater than near; -1 means infinite)

setCameraPosition

public final void setCameraPosition(int ID,
                                    float x,
                                    float y,
                                    float z)
Description copied from interface: anfy3dAPI
set the position of a Camera (default is 0,0,10)
Specified by:
setCameraPosition in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
x - x position
y - y position
z - z position

setCameraMatrix

public final void setCameraMatrix(int ID,
                                  float[] m)
Description copied from interface: anfy3dAPI
set the camera transformation directly
Specified by:
setCameraMatrix in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera
m - a 4x3 matrix that contains the transformation

setSceneRoot

public final void setSceneRoot(int ID)
Description copied from interface: anfy3dAPI
set the root Transform for the scene
Specified by:
setSceneRoot in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Transform that will be the root of all the scene

setSceneCamera

public final void setSceneCamera(int ID)
Description copied from interface: anfy3dAPI
set the active Camera for the scene
Specified by:
setSceneCamera in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Camera that will be used to render the scene

setLightColor

public final void setLightColor(int ID,
                                float r,
                                float g,
                                float b)
Description copied from interface: anfy3dAPI
set the color of a Light
Specified by:
setLightColor in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Light
r - red component
g - green component
b - blue component

setLightIntensity

public final void setLightIntensity(int ID,
                                    float i)
Description copied from interface: anfy3dAPI
set the intensity of a Light
Specified by:
setLightIntensity in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Light
i - the intensity (range 0.0-1.0)

setLightActive

public final void setLightActive(int ID,
                                 boolean flag)
Description copied from interface: anfy3dAPI
switch on/off a Light
Specified by:
setLightActive in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Light
flag - true-on, false-off

setLightDirection

public final void setLightDirection(int ID,
                                    float x,
                                    float y,
                                    float z)
Description copied from interface: anfy3dAPI
set the direction of a Directional Light
Specified by:
setLightDirection in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of a Directional Light
x - x axis component
y - y axis component
z - z axis component

setLightAttenuation

public final void setLightAttenuation(int ID,
                                      float x,
                                      float y,
                                      float z)
Description copied from interface: anfy3dAPI
set the attenuation of an Omni Light; as attenuation formula is used: atten = 1/max(a+b*d+c*d*d,1) where d is the distance of a point from the light
Specified by:
setLightAttenuation in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Omni Light
a -  
b -  
c -  

setLightPosition

public final void setLightPosition(int ID,
                                   float x,
                                   float y,
                                   float z)
Description copied from interface: anfy3dAPI
set the position of an Omni Light
Specified by:
setLightPosition in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Omni Light
x - x position
y - y position
z - z position

setLightRadius

public final void setLightRadius(int ID,
                                 float r)
Description copied from interface: anfy3dAPI
set the radius of illumination of an Omni Light
Specified by:
setLightRadius in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the Omni Light
r - the radius

grow

public int[][][] grow(int[][][] start)

delete

public final void delete(int ID)
Description copied from interface: anfy3dAPI
delete an item from memory. Please note that the item should not be used anymore by the scene
Specified by:
delete in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
ID - the ID of the item to delete

clearScene

public void clearScene()
Description copied from interface: anfy3dAPI
clears all the items contained inside a scene. Totally frees the scene
Specified by:
clearScene in interface anfy3dAPI

render

public final void render()
Description copied from interface: anfy3dAPI
renders a scene. You must always call this between a beginScene() and an endScene() Please note that even if you call render() you don't know when the scene will be really rendered. For example under the software version you're sure that: 1- when you call beginScene() the screen will be cleared (and background will be copied) 2- when you call render() the scene will be rendered 3- when you call endScene() the scene will be copied to the screen So you must animate etc between a beginScene() and a render() and it will always work under any implementation of the engine. (Anyway you can use its real behaviour for example if you're using the rSOFTWARE engine)
Specified by:
render in interface anfy3dAPI

pick

public int pick(float x,
                float y,
                float z,
                float nx,
                float ny,
                float nz,
                float[] info,
                int[] matInfo,
                float[] texInfo,
                float[] normalInfo)
Description copied from interface: anfy3dAPI
picks the object that intersect a ray. After this call the info array will contain: info[0]=distance,info[1]=x,info[2]=y,info[3]=z
Specified by:
pick in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
x - x start position of the ray
y - y start position of the ray
z - z start position of the ray
nx - x axis direction of the ray
ny - y axis direction of the ray
nz - z axis direction of the ray
info - a float array of dimension 4 to store distance and intersecting point or null if you don't want these datas o be calculated
matInfo - an int array of dimension 2 that will contain the material and texture picked (or -1 if mesh has not material or texture) if null these datas will not be returned
texInfo - a float array of dimension 2 that will contain the coordinate of the texel picked on the texture or null
normalInfo - a float array of dimension 3 that will contain the normal of the face picked or null
Returns:
the ID of the picked Mesh or -1 if no Mesh has been picked

pick

public final int pick(int mousex,
                      int mousey,
                      float[] info,
                      int[] matInfo,
                      float[] texInfo,
                      float[] normalInfo)
Description copied from interface: anfy3dAPI
picks the object that is under the mouse
Specified by:
pick in interface anfy3dAPI
Following copied from interface: a3dAPI.anfy3dAPI
Parameters:
mousex - x mouse position
mousey - y mouse position
info - a float array of dimension 4 to store distance and intersecting point or null
matInfo - an int array of dimension 2 that will contain the material and texture picked (or -1 if mesh has not material or texture) if null these datas will not be returned
normalInfo - a float array of dimension 3 that will contain the normal of the face picked or null
Returns:
the ID of the picked Mesh or -1 if no Mesh has been picked


(C)2000 by Andrea Fasce