Global

Members

(constant) AffineTrans :AffineTrans

Afine transformation definition.
This is only a type declaration for generating API docs and clarifying OOP concept.

Data structure: {AffineType: para}
Where affine type is defined with AffineType:
translate: {translate: [x, y, z]}
interpos: {positions, t}, where positions is a 2 elements array of vec3
rotate: {rotate: {deg, axis: [x, y, z]}}
reflect: {reflect: xyz}
scale: {scale}
Type:
Source:

(constant) AffineType :AffineType

Type:
Source:

(constant) glx :string

Glsl sub functions

Type:
  • string
Properties:
Name Type Description
u_alpha string

uniform float u_alpha

Used for keep the name consists.
u_whiteAlpha string

uniform float whiteAlpha

Used for keep the name consists.
bitTrue string

Is the bit is true?
At least better than this:
a = ...5, bit = 2 (start at 0), a_rem = a % 2^3 = 5, div = 5 / 4 >= 1

Reference: WebGL 1.0 API Quick Reference Card

fractuv string

Get repeating uv for texture sampling.

TODO doc: debug notes: uv must be continuous
https://community.khronos.org/t/texture-wrapping-in-shader-mipmapping/53799
https://www.shadertoy.com/view/4t2yRD
https://iquilezles.org/www/articles/tunnel/tunnel.htm

intenseAlpha string

Change intensity to mix argument t = : 1 - 1/(2 * intense), when x > 1 1/2 * x, when 0 <= x <= 1 0, when x < 0

fresnelAlpha string

Get alpha according to eye and normal angle, can be applied to texture.

function: float fresnelAlpha(vec3 e, vec3 P, vec3 np)
param:
e: eye P: position np: normal return:
alpha value like of fresnel effect.
sdEllipsoid string

Find distance to ellipsoid

thermalColor string

Mix 3 colors of interposition t

pointFace string
Fragment Function.
box2 string
Fragment Function.
2D round box distance
parameters:
function: float box2(vec2 p, vec2 size, float r)
p {vec2}: varying from vertex poisition, transformed to world
size {vec2}: box size
r {float}: corner radius
return {float}: distance
box3 string
Fragment Function.
3D round box distance
parameters:
function: float box2(vec2 p, vec2 size, float r)
p {vec3}: varying from vertex poisition, transformed to world
size {vec3}: box size
r {float}: corner radius
return {float}: distance
line string

Line Rasterize Function. https://math.stackexchange.com/questions/2213165/find-shortest-distance-between-lines-in-3d 𝐧 = 𝐞1 × 𝐞2 = (−20, −11, −26) return {float}: distance

rotate2 string

Rotate in 2D for angle of radian. function: vec2 rotate2(float radi, vec2 v) parameters:
radi {float} angle in radian v {vec2} vectore to be rotated return m * v. where m = c s -s c

rotateY string
rayPlaneInsec string

Ray plane intersection. function: vec4 rayPlaneInsec(vec3 l0, vec3 l, vec3 p0, vec3 n) return vec4 (pos, distance), distance > 0 iff there is one point. Reference: wikipedia

box3Color string

Get color weight according to xy, yz, xz box distance. Thes function depends on glx.rotateY, glx.rayPlaneInsec, glx.box3 return colore weight

phongLight string

Get phong light.
sub function lambershine():
Lambert's cosine law
return: vec2(lambertian, specular)
To use in phong:

vColor = vec4(Ka * ambientColor +
Kd * lambertian * diffuseColor +
Ks * specular * specular, u_alpha);
Code Comments:
lambertian: angle between normal and incident
R: reflect direction
V: vector to viewer

External Link
x-visual doc: Morphing Phong Material
referencing implementation @ cs.toronto.edu
Lambertian Emitters and Scatters
buildingAlpha string
Vertex Shader
Get building wall texture's alpha - used for transparent building like glass cube, without refrection.
shadow string
Source:

(constant) KeyFlag :int

Key flags.

Type:
  • int
Properties:
Name Type Description
ctrl int

ctrl key down

shift int

shift key down

alt int

alt key down

Source:

(constant) LayerChannel :LayerChannel

value of 0 - 31, 0 is reserved for all in xscene. (mask = 1)

For layers, see three.js doc: https://threejs.org/docs/index.html#api/en/core/Layers

NONE: all invisible USER: the starting chennle for ChannelFilter. ALL: show all objects FLOWING_PATH: PathEffect effect pass GLOW: GlowEffect effect pass BLURRING: not used? FILMING: FilmEffect effect pass

Type:
Source:

(constant) R

Earth Radius hold by OSM, see osm wiki: zoom level

TODO use EPSG parameters as a common module.

Source:

x

Properties:
Name Type Description
x ECS

x-visual global data (singleton)

Source:

(constant) XEasing :XEasing

Tween easing function

Type:
Source:

Methods

browserVer(log) → {object}

Get browser name and version.

Parameters:
Name Type Description
log bool

true will log with console.

Source:
Returns:

{name, version}

Type
object

getEffectPass(ecs, x) → {object}

Get effect passes. Called by super class Orthocclude

Parameters:
Name Type Description
ecs ECS
x object

TODO options
options.glow: glow parameters
options.bloom: bloom parameters.
See Glow Example.
options.film: filem parameters

Source:
Returns:

{effects, layers}, where
effects: [renderPass, bloomPass, filmPass]
layers: Layers visible through channel LayerChannel.FLOWING_PATH.

Type
object

interpret(code, e) → {object}

default input events interpretor.

Parameters:
Name Type Description
code string
e MouseEvent
Source:
Returns:

{code, cmd, client, e}
where
code = 'key' | 'mouse'
cmd = Cmd | MouseEvent.type
client: [x, y] only for mouse event
e: MouseEvent, only for mouse event

Type
object

onMouse()

Kept until delete branch temp-sankey-debug1

Source: