Package com.ijurnove.cpu3d
package com.ijurnove.cpu3d
To generate a 3D render, you must have a
Scene containing a set of Shape3ds, a set of Lights, and a Camera.
This package comes with a built-in .obj file reader to generate Meshes and a image reader to generate textures, both of which are required for a
Shape3d. Materials are required as well to define how the Shape3d interacts with light. A few example Materials have
already been made, but more can be created easily.
In addition to a Shape3d[], a Light[], and a Camera, a SceneInitFlags object must be created to define things
such as shadow resolution and image size. After getting all of these and constructing a Scene, it can be rendered with the .render() method.
-
ClassDescription
Cameraobjects define a viewpoint from which aScenecan be rendered.DirectionalLight is a Light with a direction but no specific position.Objects that extend theLightclass are used bySceneto calculate lighting.TheMaterialclass defines how light interacts with a surface.AMatrixstores a two dimensional array of doubles.AMeshconsists of a set ofTriangles.ObjReadercontains one method,read(), for converting an .obj file to aMesh.APhongComponentsobject contains information about lighting, for the Blinn-Phong lighting model.APoint3dis a specific point in 3D space.PointLightextends the abstract classLight.This interface allows objects in 3D space to be rotated.This interface allows objects in 3D space to be scaled.ASceneconsists of a set ofShape3ds, a set ofLights, and aCamera.SceneFlagvalues are used as keys inSceneFlags.SceneFlagsis used in aSceneto toggle certain features or change specific values.SceneInitFlagvalues are used as keys inSceneInitFlags.SceneInitFlagsis used in aSceneto set certain values at initialization.Shape3ds represent a three-dimensional shape with a texture and a material.ShapeFlags are used to toggle specific features in aShape3d.Texturescontains one method for reading image files,Textures.read().This interface allows objects in 3D space to be translated.ATriangleholds threePoint3ds, three point normals, threeUVcoordinates, and one surface normal.UVcoordinates represent a point on a texture.AVector3drepresents a direction in 3D space.