### Start Pixi3D Local Server Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/index.html Navigate to your project directory and start the local web server. ```bash cd my-pixi3d-app npm start ``` -------------------------------- ### Install Pixi3D Source: https://context7.com/jnsmalm/pixi3d/llms.txt Install Pixi3D using npm or scaffold a new project with create-pixi3d-app. ```bash npm install pixi3d # or scaffold a new project: npx create-pixi3d-app@latest my-app ``` -------------------------------- ### Manual Pixi3D Setup with Cube Source: https://github.com/jnsmalm/pixi3d/blob/develop/README.md Basic setup for Pixi3D, creating a PixiJS application and adding a rotating 3D cube. Requires manual inclusion of pixi.js and pixi3d.js. ```javascript let app = new PIXI.Application({ backgroundColor: 0xdddddd, resizeTo: window, antialias: true }) document.body.appendChild(app.view) let mesh = app.stage.addChild(PIXI3D.Mesh3D.createCube()) let light = new PIXI3D.Light() light.position.set(-1, 0, 3) PIXI3D.LightingEnvironment.main.lights.push(light) let rotation = 0 app.ticker.add(() => { mesh.rotationQuaternion.setEulerAngles(0, rotation++, 0) }) ``` -------------------------------- ### Install Pixi3D via npm Source: https://github.com/jnsmalm/pixi3d/blob/develop/README.md Install Pixi3D using npm. The import path differs based on the PixiJS version used. ```bash npm install pixi3d ``` -------------------------------- ### start Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/SpriteBatchRenderer.html Starts a new sprite batch. This method is inherited from BatchRenderer. ```APIDOC ## start ### Description Starts a new sprite batch. This method is inherited from BatchRenderer. ### Method Signature start(): void ### Returns void ``` -------------------------------- ### onTouchStart Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CameraOrbitControl.html Handles touch start events for orbit control. ```APIDOC ## onTouchStart(e: TouchEvent): void ### Description Handles touch start events for orbit control. ### Parameters #### Path Parameters - **e** (TouchEvent) - Description ### Returns void ``` -------------------------------- ### start Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/StandardPipeline.html Initializes the renderer, preparing it for rendering operations. This is called when the renderer is specifically requested. ```APIDOC ## start ### Description Stub method that initializes any state required before rendering starts. It is different from the `prerender` signal, which occurs every frame, in that it is called whenever an object requests _this_ renderer specifically. ### Method Signature start(): void ### Returns - **Type**: void ``` -------------------------------- ### onPrerender Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/SpriteBatchRenderer.html Handles the prerender signal, ensuring flushes start from the first geometry object. ```APIDOC ## onPrerender ### Description Handles the `prerender` signal. It ensures that flushes start from the first geometry object again. ### Method onPrerender ### Returns void ``` -------------------------------- ### Basic Pixi3D Scene Setup Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/index.html Initialize a PixiJS application, add a 3D cube, a light source, and set up a rotation animation. Requires pixi.js and pixi3d.js to be included. ```javascript let app = new PIXI.Application({ backgroundColor: 0xdddddd, resizeTo: window, antialias: true}) document.body.appendChild(app.view) let mesh = app.stage.addChild(PIXI3D.Mesh3D.createCube()) let light = new PIXI3D.Light() light.position.set(-1, 0, 3) PIXI3D.LightingEnvironment.main.lights.push(light) let rotation = 0 app.ticker.add(() => { mesh.rotationQuaternion.setEulerAngles(0, rotation++, 0) }) ``` -------------------------------- ### Create Pixi3D App with npx Source: https://github.com/jnsmalm/pixi3d/blob/develop/README.md Use this command to set up a new Pixi3D project with all necessary configurations. Ensure Node.js is installed. ```bash npx create-pixi3d-app@latest my-pixi3d-app ``` -------------------------------- ### getLocalBounds Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets the local bounds of the container. ```APIDOC ## getLocalBounds(localBounds?: Bounds): Bounds ### Description Gets the local bounds of the container. ### Parameters #### Path Parameters - **localBounds** (Bounds) - The bounds object to store the local bounds in. ### Returns - Bounds - The local bounds of the container. ``` -------------------------------- ### getChildByName Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets the child with a specific name. ```APIDOC ## getChildByName(name: string, ceb?: boolean): DisplayObject | undefined ### Description Gets the child with a specific name. ### Parameters #### Path Parameters - **name** (string) - The name of the child to retrieve. - **ceb** (boolean) - If true, the child will be created if it does not exist. ### Returns - DisplayObject | undefined - The child with the specified name, or undefined if not found. ``` -------------------------------- ### Initialize ImageBasedLighting Source: https://context7.com/jnsmalm/pixi3d/llms.txt Set up environment-based lighting using diffuse and specular cubemaps. Ensure cubemap textures are loaded before initialization. This can be combined with punctual lights. ```javascript import { ImageBasedLighting, Cubemap, LightingEnvironment } from "pixi3d" // Load cubemap textures via PixiJS v7 Assets const diffuseCubemap = await PIXI.Assets.load("assets/env/diffuse.cubemap") const specularCubemap = await PIXI.Assets.load("assets/env/specular.cubemap") const ibl = new ImageBasedLighting(diffuseCubemap, specularCubemap) LightingEnvironment.main.imageBasedLighting = ibl // Verify it's valid before rendering console.log("IBL valid:", ibl.valid) // Can be combined with punctual lights const fillLight = new Light() fillLight.type = LightType.directional fillLight.intensity = 0.3 LightingEnvironment.main.lights.push(fillLight) ``` -------------------------------- ### getBounds Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets the global bounds of the container. ```APIDOC ## getBounds(skipUpdate?: boolean): Bounds ### Description Gets the global bounds of the container. ### Parameters #### Path Parameters - **skipUpdate** (boolean) - If true, the bounds will not be updated before being returned. ### Returns - Bounds - The global bounds of the container. ``` -------------------------------- ### PIXI.Application and Renderer Setup with Pixi3D Source: https://context7.com/jnsmalm/pixi3d/llms.txt Set up a PixiJS application and add a rotating cube with a point light and camera orbit control. Pixi3D plugins are registered automatically. ```javascript import * as PIXI from "pixi.js" import { Mesh3D, Light, LightingEnvironment, CameraOrbitControl, Color } from "pixi3d" const app = new PIXI.Application({ resizeTo: window, backgroundColor: 0x1a1a2e, antialias: true }) document.body.appendChild(app.view) // Create a rotating cube with a point light const cube = app.stage.addChild(Mesh3D.createCube()) const light = new Light() light.position.set(-1, 0, 3) LightingEnvironment.main.lights.push(light) const orbitControl = new CameraOrbitControl(app.view) let rotation = 0 app.ticker.add(() => { cube.rotationQuaternion.setEulerAngles(0, rotation++, 0) }) ``` -------------------------------- ### scale Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Light.html Gets or sets the scale of the object. ```APIDOC ## scale ### Description Gets or sets the scale of the object. ### Getter * **scale**: [Point3D](Point3D.html) ### Setter * **scale**: value: [Point3D](Point3D.html) ### Returns * Getter: [Point3D](Point3D.html) * Setter: void ``` -------------------------------- ### localTransform Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Sprite3D.html Gets the local transformation matrix of the sprite. ```APIDOC ## localTransform ### Description Gets the local transformation matrix of the sprite. ### Method GET ### Returns * **get localTransform()**: Matrix4x4 - The local transformation matrix. ``` -------------------------------- ### localTransform Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Model.html Gets the local transformation matrix of the container. ```APIDOC ## localTransform ### Description Gets the local transformation matrix of the container. ### Accessor - **get localTransform()**: [Matrix4x4](Matrix4x4.html) - Returns the local transformation matrix. ``` -------------------------------- ### LightingEnvironment Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/LightingEnvironment.html Initializes a new LightingEnvironment. It can optionally take an ImageBasedLighting object. ```APIDOC ## constructor ### Description Creates a new lighting environment using the specified renderer. ### Parameters #### Path Parameters * **renderer** (Renderer) - Required - The renderer to use. * **imageBasedLighting** (ImageBasedLighting) - Optional - The image based lighting to use. ### Returns [LightingEnvironment] ``` -------------------------------- ### use Method Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/modules.html Registers a plugin to handle specific resource types during the loading process. ```APIDOC ## use ### Description Registers a plugin to handle specific resource types during the loading process. ### Method `use(resource: LoaderResource, next: () => void)` ### Parameters #### Parameters - **resource**: `LoaderResource` - The resource to be processed. - **next**: `() => void` - The callback function to proceed to the next step in the loading queue. ### Returns `void` ``` -------------------------------- ### angle Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Model.html Gets or sets the angle of the object in degrees. ```APIDOC ## angle ### Description Gets or sets the angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. ### Accessors - **get angle()**: number - Returns the current angle in degrees. - **set angle(value: number)**: void - Sets the angle in degrees. ``` -------------------------------- ### Camera Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html Initializes a new instance of the Camera class. ```APIDOC ## Camera Constructor ### Description Initializes a new instance of the Camera class. ### Parameters None explicitly documented for the constructor itself. ### Returns An instance of the Camera class. ``` -------------------------------- ### y Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets or sets the y-coordinate of the object relative to its parent. ```APIDOC ## y ### Description The position of the displayObject on the y axis relative to the local coordinates of the parent. An alias to position.y ### Getter * **y**: number ### Setter * **y**: (value: number): void ``` -------------------------------- ### scale Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets or sets the scale of the object as a Point3D. ```APIDOC ## scale ### Description Gets or sets the scale of the object. ### Getter * **scale**: [Point3D](Point3D.html) ### Setter * **scale**: (value: [Point3D](Point3D.html)): void ``` -------------------------------- ### StandardPipeline Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/StandardPipeline.html Initializes a new StandardPipeline instance with the provided renderer. ```APIDOC ## constructor ### Description Creates a new standard pipeline using the specified renderer. ### Parameters #### Parameters * **renderer**: Renderer - The renderer to use. ### Returns [StandardPipeline] ``` -------------------------------- ### rotation Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Sets or gets the rotation of the object in radians. ```APIDOC ## rotation ### Description The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. ### Method GETTER / SETTER ### Parameters #### value: number ### Returns number (for getter) void (for setter) ``` -------------------------------- ### Camera Static Main Instance Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html The `main` static property provides access to the default Camera instance used for rendering. ```APIDOC ## Static main ### Description Main camera which is used by default. ### Type [Camera](Camera.html) ### Defined in [src/camera/camera.ts:52](https://github.com/jnsmalm/pixi3d/blob/576779d/src/camera/camera.ts#L52) ``` -------------------------------- ### width Property Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/StandardMaterialTexture.html Gets the width of the Texture in pixels. ```APIDOC ## width ### Description The width of the Texture in pixels. ### Returns number ``` -------------------------------- ### Configure Scene Lighting with Light and LightingEnvironment Source: https://context7.com/jnsmalm/pixi3d/llms.txt Sets up various light types (directional, point, spot) and adds them to a LightingEnvironment. Allows for shared or per-object lighting configurations. ```javascript import { Light, LightingEnvironment, LightType, Color } from "pixi3d" // Directional light (sun) const sun = new Light() sun.type = LightType.directional sun.intensity = 2.0 sun.color = new Color(1, 0.95, 0.8) sun.rotationQuaternion.setEulerAngles(45, 135, 0) LightingEnvironment.main.lights.push(sun) ``` ```javascript // Point light (lamp) const lamp = new Light() lamp.type = LightType.point lamp.intensity = 15 lamp.range = 20 lamp.color = Color.fromHex("#ffe4b5") lamp.position.set(2, 3, 1) LightingEnvironment.main.lights.push(lamp) ``` ```javascript // Spot light const spot = new Light() spot.type = LightType.spot spot.intensity = 25 spot.innerConeAngle = 15 // degrees spot.outerConeAngle = 30 // degrees spot.position.set(0, 5, 0) spot.rotationQuaternion.setEulerAngles(90, 0, 0) LightingEnvironment.main.lights.push(spot) ``` ```javascript // Per-object lighting environment import { LightingEnvironment } from "pixi3d" const customEnv = new LightingEnvironment(app.renderer) const redLight = new Light() redLight.color = new Color(1, 0, 0) customEnv.lights.push(redLight) mesh.material.lightingEnvironment = customEnv ``` -------------------------------- ### getChildIndex Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets the index of a child within the container. ```APIDOC ## getChildIndex(child: DisplayObject): number ### Description Gets the index of a child within the container. ### Parameters #### Path Parameters - **child** (DisplayObject) - The child to find the index of. ### Returns - number - The index of the child. ``` -------------------------------- ### InstancedModel Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedModel.html Initializes a new instance of the InstancedModel class. ```APIDOC ## constructor InstancedModel() ### Description Initializes a new instance of the InstancedModel class. ### Method constructor ### Parameters None ``` -------------------------------- ### worldTransform Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets the world transform matrix of the InstancedMesh3D. ```APIDOC ## worldTransform ### Description Gets the world transform matrix of the InstancedMesh3D. ### Getter - **worldTransform**(): [Matrix4x4](Matrix4x4.html) ``` -------------------------------- ### scale Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets or sets the local scale of the InstancedMesh3D. ```APIDOC ## scale ### Description Gets or sets the local scale of the InstancedMesh3D. ### Getter - **scale**(): [Point3D](Point3D.html) ### Setter - **scale**(value: [Point3D](Point3D.html)): void ``` -------------------------------- ### Configure Pixi3D Mocha Tests Source: https://github.com/jnsmalm/pixi3d/blob/develop/test/index.html Sets up Mocha test environment, including version checking and timeouts. Ensure PIXI is globally available. ```javascript let [major, minor, patch] = window.PIXI.VERSION.split(".") mocha.setup({ ui: "bdd", grep: new RegExp(`pixi [${major}|*].[${minor}|*].[${patch}|*]`) }) mocha.slow(5000) mocha.timeout(10000) mocha.checkLeaks() mocha.run() ``` -------------------------------- ### localTransform Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedModel.html Gets the local transformation matrix of the object. ```APIDOC ## localTransform ### Description Gets the local transformation matrix of the object. ### Method Getter ### Returns [Matrix4x4](Matrix4x4.html) - The local transformation matrix. ``` -------------------------------- ### initFromArray Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CubemapResource.html Initializes the resource from an array of sources. This method is protected and used internally. ```APIDOC ## initFromArray ### Description Initializes the resource from an array of sources. Used from ArrayResource and CubeResource constructors. ### Method initFromArray(resources: any[], options?: IAutoDetectOptions): void ### Parameters #### Path Parameters - **resources** (any[]) - Required - Can be resources, image elements, canvas, etc., length should be same as constructor length. - **options** (IAutoDetectOptions) - Optional - Detect options for resources. ``` -------------------------------- ### Create PixiJS Application Source: https://github.com/jnsmalm/pixi3d/blob/develop/README.md Initializes a PixiJS application with a renderer and canvas. Add the canvas to the document body to display it. ```javascript let app = new PIXI.Application({ resizeTo: window, backgroundColor: 0xdddddd, antialias: true }); document.body.appendChild(app.view); ``` -------------------------------- ### Plane.normal Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Plane.html Gets the normal vector of the plane. ```APIDOC ## normal ### Description Gets the normal vector of the plane. ### Signature get normal(): Point3D ### Returns * Point3D - The normal vector of the plane. ``` -------------------------------- ### Create PixiJS Application Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/index.html Creates a PixiJS application instance and appends its view to the document body. This sets up the rendering context and canvas. ```javascript let app = new PIXI.Application({ resizeTo: window, backgroundColor: 0xdddddd, antialias: true});document.body.appendChild(app.view); ``` -------------------------------- ### Plane.distance Property Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Plane.html Gets the distance of the plane from the origin. ```APIDOC ## distance ### Description Gets the distance of the plane from the origin. ### Type number ``` -------------------------------- ### AABB.size Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/AABB.html Gets the size of the bounding box. ```APIDOC ## size ### Description The size of the bounding box. ### Returns - [Point3D](Point3D.html) ``` -------------------------------- ### StandardMaterial Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/StandardMaterial.html Initializes a new instance of the StandardMaterial. ```APIDOC ## constructor StandardMaterial ### Description Initializes a new instance of the StandardMaterial. ### Method constructor ### Returns - [StandardMaterial](StandardMaterial.html) ``` -------------------------------- ### Cubemap Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Cubemap.html Initializes a new Cubemap instance. It can optionally take a resource and options for configuration. ```APIDOC ## constructor ### Description Initializes a new Cubemap instance. It can optionally take a resource and options for configuration. ### Signature ```typescript new Cubemap(resource?: any, options?: IBaseTextureOptions): Cubemap ``` ### Parameters * **resource** (any) - Optional. The resource to use for the cubemap. * **options** (IBaseTextureOptions) - Optional. Collection of options for the cubemap. ### Returns * **Cubemap** - A new Cubemap instance. ``` -------------------------------- ### AABB.extents Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/AABB.html Gets the extents of the bounding box. ```APIDOC ## extents ### Description The extents of the bounding box. ### Returns - [Point3D](Point3D.html) ``` -------------------------------- ### Static Methods Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Sprite3D.html A collection of static utility methods for Sprite3D instances. ```APIDOC ## Static Methods This section lists static methods available on the Sprite3D class. ### `removeChildren(sprite: Sprite3D, beginIndex?: number, endIndex?: number): void` Removes a range of children from the sprite. ### `removeListener(sprite: Sprite3D, event: string, fn: Function, once?: boolean): Sprite3D` Removes a listener from the sprite. ### `render(sprite: Sprite3D, renderSession: IRenderSession): void` Renders the sprite. ### `renderAdvanced(sprite: Sprite3D, renderSession: IRenderSession): void` Renders the sprite using advanced rendering techniques. ### `setChildIndex(sprite: Sprite3D, child: DisplayObject, index: number): void` Sets the child index of a child within the sprite. ### `setParent(sprite: Sprite3D, parent: DisplayObjectContainer): DisplayObjectContainer` Sets the parent of the sprite. ### `setTransform(sprite: Sprite3D, x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): void` Sets the transform properties of the sprite. ### `sortChildren(sprite: Sprite3D): void` Sorts the children of the sprite. ### `swapChildren(sprite: Sprite3D, child1: DisplayObject, child2: DisplayObject): void` Swaps the positions of two children within the sprite. ### `toGlobal(sprite: Sprite3D, point: GlobalPoint, result?: GlobalPoint): GlobalPoint` Converts a local point to global coordinates. ### `toLocal(sprite: Sprite3D, point: GlobalPoint, from?: DisplayObject, result?: Point, localCoord?: number): Point` Converts a global point to local coordinates. ### `updateTransform(sprite: Sprite3D): void` Updates the transform of the sprite. ### `mixin(target: any, source: any): void` Mixes properties from a source object into a target object. ``` -------------------------------- ### ImageBasedLighting Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/ImageBasedLighting.html Creates a new image-based lighting object with specified diffuse and specular cubemaps. ```APIDOC ## constructor ### Description Creates a new image-based lighting object. ### Signature ```typescript new ImageBasedLighting(diffuse: Cubemap, specular: Cubemap): ImageBasedLighting ``` ### Parameters #### Parameters * **diffuse** (Cubemap) - Cubemap used for the diffuse component. * **specular** (Cubemap) - Cubemap used for the specular component. ### Returns [ImageBasedLighting](ImageBasedLighting.html) ``` -------------------------------- ### texture Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Sprite3D.html Gets or sets the texture used when rendering the sprite. ```APIDOC ## texture ### Description Gets or sets the texture used when rendering the sprite. ### Getter - **texture**(): Texture ### Setter - **texture**(value: Texture): void ``` -------------------------------- ### z Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets or sets the z-coordinate of the object relative to its parent. ```APIDOC ## z ### Description The position of the object on the z axis relative to the local coordinates of the parent. ### Getter * **z**: number ### Setter * **z**: (value: number): void ``` -------------------------------- ### load Method Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/modules.html Initiates the loading of a glTF asset from a specified URL. ```APIDOC ## load ### Description Initiates the loading of a glTF asset from a specified URL. ### Method `load(url: string): Promise` ### Parameters #### Parameters - **url**: `string` - The URL of the glTF asset to load. ### Returns `Promise` - A promise that resolves with the loaded glTF asset. ``` -------------------------------- ### x Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Container3D.html Gets or sets the x-coordinate of the object relative to its parent. ```APIDOC ## x ### Description The position of the displayObject on the x axis relative to the local coordinates of the parent. An alias to position.x ### Getter * **x**: number ### Setter * **x**: (value: number): void ``` -------------------------------- ### Light Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Light.html Initializes a new instance of the Light class. This constructor is inherited from Container3D. ```APIDOC ## constructor Light() ### Description Initializes a new instance of the Light class. ### Returns - [Light](Light.html) - A new Light instance. ``` -------------------------------- ### position Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Mesh3D.html Sets or gets the 3D position of the display object. ```APIDOC ## position ### Description Sets or gets the 3D position of the display object. ### Getter * **Returns**: [Point3D](Point3D.html) ### Setter * **Parameters** * value: [Point3D](Point3D.html) * **Returns**: void ``` -------------------------------- ### Material.from Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Material.html Factory method to create a new Material instance from provided vertex and fragment shader source code. ```APIDOC ## Material.from ### Description Creates a new material from the specified vertex/fragment source. ### Method POST ### Endpoint /Material/from ### Parameters #### Request Body - **vertexSrc**: string - Required - The vertex shader source. - **fragmentSrc**: string - Required - The fragment shader source. - **updateUniforms**: (mesh: [Mesh3D], shader: [MeshShader]) => void - Optional - The function which will be called for updating the shader uniforms. - **mesh**: [Mesh3D] - Required - **shader**: [MeshShader] - Required ### Returns - **[Material]**: A new Material instance. ``` -------------------------------- ### Fog Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Fog.html Initializes a new Fog instance. You can optionally provide near and far distances, and a Color object. ```APIDOC ## constructor ### Description Initializes a new Fog instance. ### Signature ```typescript new Fog(near?: number, far?: number, color?: Color): Fog ``` ### Parameters #### near * **near** (number) - Optional. The near distance for the fog effect. Defaults to 5. #### far * **far** (number) - Optional. The far distance for the fog effect. Defaults to 50. #### color * **color** ([Color](Color.html)) - Optional. The color of the fog. Defaults to a predefined color. ### Returns * [Fog](Fog.html) - A new Fog instance. ``` -------------------------------- ### Texture Property Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CompositeSprite.html Gets or sets the texture that the sprite is using. ```APIDOC ## texture ### Description The texture that the sprite is using. ### Method GET/SET ### Parameters * `value` (Texture): The new texture to apply to the sprite. ### Returns * `Texture`: The current texture being used by the sprite. * `void`: When setting the texture. ``` -------------------------------- ### renderTexture Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CompositeSprite.html Gets the render texture associated with the composite sprite. ```APIDOC ## renderTexture ### Description The render texture. ### Returns * get renderTexture(): RenderTexture The render texture. ``` -------------------------------- ### InstancedStandardMaterial Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedStandardMaterial.html Creates a new instanced standard material from the specified material. ```APIDOC ## constructor ### Description Creates a new instanced standard material from the specified material. ### Signature new InstancedStandardMaterial(material: StandardMaterial): InstancedStandardMaterial ### Parameters * **material** (StandardMaterial) - The base StandardMaterial to use for instancing. ### Returns * **InstancedStandardMaterial** - A new instance of InstancedStandardMaterial. ``` -------------------------------- ### rotationQuaternion Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html Gets or sets the camera's rotation as a quaternion. ```APIDOC ## rotationQuaternion ### Description Gets or sets the camera's rotation as a quaternion. ### Getter - **rotationQuaternion**(): [Quaternion](Quaternion.html) ### Setter - **rotationQuaternion**(value: [Quaternion](Quaternion.html)): void ``` -------------------------------- ### Static create Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Vec3.html Creates a new, empty 3D vector initialized to [0, 0, 0]. ```APIDOC ## Static create ### Description Creates a new, empty 3D vector initialized to [0, 0, 0]. ### Returns - **Float32Array**: A new 3D vector. ``` -------------------------------- ### AABB Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/AABB.html Initializes a new AABB instance. ```APIDOC ## constructor ### Description Initializes a new AABB instance. ### Returns - [AABB](AABB.html) ``` -------------------------------- ### rotation Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html Gets or sets the camera's rotation in radians. ```APIDOC ## rotation ### Description Gets or sets the camera's rotation in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. ### Getter - **rotation**(): number ### Setter - **rotation**(value: number): void ``` -------------------------------- ### rotationQuaternion Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets or sets the local quaternion rotation of the InstancedMesh3D. ```APIDOC ## rotationQuaternion ### Description Gets or sets the local quaternion rotation of the InstancedMesh3D. ### Getter - **rotationQuaternion**(): [Quaternion](Quaternion.html) ### Setter - **rotationQuaternion**(value: [Quaternion](Quaternion.html)): void ``` -------------------------------- ### Material Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Material.html Initializes a new Material instance. Materials are used to render a mesh with a specific visual appearance. ```APIDOC ## constructor * new Material(): [Material](Material.html) ### Returns * [Material](Material.html) ``` -------------------------------- ### rotation Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets or sets the local rotation of the InstancedMesh3D in radians. ```APIDOC ## rotation ### Description Gets or sets the local rotation of the InstancedMesh3D in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees. ### Getter - **rotation**(): number ### Setter - **rotation**(value: number): void ``` -------------------------------- ### onPointerUp Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CameraOrbitControl.html Handles pointer up events for orbit control. ```APIDOC ## onPointerUp(): void ### Description Handles pointer up events for orbit control. ### Returns void ``` -------------------------------- ### Ray Direction Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Ray.html Gets the direction vector of the Ray. ```APIDOC ## direction ### Description Gets the direction vector of the Ray. ### Returns [Point3D](Point3D.html) - The direction vector of the ray. ``` -------------------------------- ### MeshGeometry3D Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/MeshGeometry3D.html Initializes a new instance of MeshGeometry3D. ```APIDOC ## constructor * new MeshGeometry3D(): [MeshGeometry3D](MeshGeometry3D.html) ### Returns * [MeshGeometry3D](MeshGeometry3D.html) ``` -------------------------------- ### Ray Origin Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Ray.html Gets the origin point of the Ray. ```APIDOC ## origin ### Description Gets the origin point of the Ray. ### Returns [Point3D](Point3D.html) - The origin point of the ray. ``` -------------------------------- ### create Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/interfaces/MaterialFactory.html Creates a new material from the specified source. This method takes an unknown source and returns a Material object. ```APIDOC ## create ### Description Creates a new material from the specified source. ### Method create(source: unknown): Material ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Request Example ```json { "source": "unknown" } ``` ### Response #### Success Response (Material) * Returns a Material object. ### Response Example ```json { "material": "Material object" } ``` ``` -------------------------------- ### Skin Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Skin.html Creates a new Skin instance. It requires a parent Container3D and an array of Joint objects. ```APIDOC ## constructor ### Description Creates a new skin. ### Parameters #### Parameters * **parent**: [Container3D](Container3D.html) - The parent container node for the skin. * **joints**: [Joint](Joint.html)[] - The array of joints included in the skin. ### Returns [Skin](Skin.html) ``` -------------------------------- ### AABB.center Accessor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/AABB.html Gets the center point of the bounding box. ```APIDOC ## center ### Description The center of the bounding box. ### Returns - [Point3D](Point3D.html) ``` -------------------------------- ### Static create Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/StandardMaterial.html Creates a new standard material from the specified source. This is a static method available on the StandardMaterial class. ```APIDOC ## Static create ### Description Creates a new standard material from the specified source. ### Method `create(source: unknown): StandardMaterial` ### Parameters #### Parameters - **source**: `unknown` - Source from which the material is created. ### Returns `StandardMaterial` - A new instance of StandardMaterial. ``` -------------------------------- ### blendMode Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Sprite3D.html Gets or sets the blend mode used when rendering the sprite. ```APIDOC ## blendMode ### Description Gets or sets the blend mode used when rendering the sprite. ### Method GET/SET ### Parameters #### Set Parameters * **value** (BLEND_MODES) - The blend mode to set. ### Returns * **get blendMode()**: BLEND_MODES - The current blend mode. * **set blendMode(value: BLEND_MODES)**: void ``` -------------------------------- ### Static fromScaling Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Matrix4x4.html Creates a matrix from a scaling point. ```APIDOC ## Static fromScaling ### Description Creates a matrix from a scaling point. ### Parameters * **v**: [Point3D](Point3D.html) - The scaling point. * **out**: [Matrix4x4](Matrix4x4.html) (Optional) - The receiving matrix. If not supplied, a new matrix will be created. ### Returns * [Matrix4x4](Matrix4x4.html) ``` -------------------------------- ### Skew Property Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CompositeSprite.html Gets or sets the skew factor for the sprite in radians. ```APIDOC ## skew ### Description The skew factor for the object in radians. ### Method GET/SET ### Parameters * `value` (IPointData): The new skew factors. Should be an object with `x` and `y` properties. ### Returns * `ObservablePoint`: The current skew factors. * `void`: When setting the skew. ``` -------------------------------- ### onPreRender Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/CameraOrbitControl.html Performs actions before rendering. ```APIDOC ## onPreRender(): void ### Description Performs actions before rendering. ### Returns void ``` -------------------------------- ### scale Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html Gets or sets the camera's scale in 3D space. ```APIDOC ## scale ### Description Gets or sets the camera's scale in 3D space. ### Getter - **scale**(): [Point3D](Point3D.html) ### Setter - **scale**(value: [Point3D](Point3D.html)): void ``` -------------------------------- ### position Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Camera.html Gets or sets the camera's position in 3D space. ```APIDOC ## position ### Description Gets or sets the camera's position in 3D space. ### Getter - **position**(): [Point3D](Point3D.html) ### Setter - **position**(value: [Point3D](Point3D.html)): void ``` -------------------------------- ### Static Methods Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Light.html The Light class provides several static methods for utility purposes. ```APIDOC ## Static Methods ### swapChildren #### Description Swaps the order of two children in the display list. ### toGlobal #### Description Converts a point from local coordinates to global coordinates. ### toLocal #### Description Converts a point from global coordinates to local coordinates. ### updateTransform #### Description Updates the transform of the display object and its children. ### mixin #### Description Applies a mixin to the Light class. ``` -------------------------------- ### Ray Constructor Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Ray.html Initializes a new Ray instance with a specified origin and direction. ```APIDOC ## constructor ### Description Initializes a new Ray instance. ### Parameters #### Parameters - **origin** (Point3D) - The starting point of the ray. - **direction** (Point3D) - The direction vector of the ray. ### Returns [Ray](Ray.html) - A new Ray instance. ``` -------------------------------- ### skew Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets or sets the local skew factor of the InstancedMesh3D in radians. ```APIDOC ## skew ### Description Gets or sets the local skew factor of the InstancedMesh3D in radians. ### Getter - **skew**(): ObservablePoint ### Setter - **skew**(value: IPointData): void ``` -------------------------------- ### createInstance Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Material.html Creates a new instanced version of the material. This is typically used in conjunction with instancing-enabled rendering. ```APIDOC ## createInstance ### Description Creates a new instanced version of this material. ### Method POST ### Endpoint /material/createInstance ### Returns - **unknown**: An instance of the material, type is unknown in this documentation. ``` -------------------------------- ### position Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/InstancedMesh3D.html Gets or sets the local position of the InstancedMesh3D in 3D space. ```APIDOC ## position ### Description Gets or sets the local position of the InstancedMesh3D in 3D space. ### Getter - **position**(): [Point3D](Point3D.html) ### Setter - **position**(value: [Point3D](Point3D.html)): void ``` -------------------------------- ### createInstance Source: https://github.com/jnsmalm/pixi3d/blob/develop/docs/classes/Mesh3D.html Creates a new instance of this mesh, returning an InstancedMesh3D. ```APIDOC ## createInstance ### Description Creates a new instance of this mesh. ### Method createInstance ### Returns [InstancedMesh3D](InstancedMesh3D.html) - A new instance of InstancedMesh3D. ```