ncca-ngl 0.5.0__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/PKG-INFO +1 -1
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/pyproject.toml +1 -1
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/__init__.py +2 -1
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/util.py +53 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vector_base.py +8 -2
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/webgpu_constants.py +2 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/LICENSE.txt +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/.ruff_cache/.gitignore +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/.ruff_cache/0.13.0/10564494386971134025 +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/.ruff_cache/0.13.0/7783445477288392980 +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/.ruff_cache/CACHEDIR.TAG +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/NGLDebug.log +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/Primitives.npz +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/buddah.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/bunny.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/cube.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/dodecahedron.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/dragon.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/football.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/icosahedron.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/octahedron.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/pack_arrays.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/teapot.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/tetrahedron.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/PrimData/troll.npy +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/abstract_vao.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/base_mesh.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/base_mesh.pyi +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/bbox.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/bezier_curve.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/first_person_camera.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/image.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/log.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/mat2.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/mat3.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/mat4.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/multi_buffer_vao.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/obj.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/plane.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/prim_data.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/primitives.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/pyside_event_handling_mixin.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/quaternion.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/random.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shader.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shader_lib.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shader_program.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/checker_fragment.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/checker_vertex.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/colour_fragment.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/colour_vertex.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/diffuse_fragment.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/diffuse_vertex.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/text_fragment.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/text_geometry.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/shaders/text_vertex.glsl +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/simple_index_vao.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/simple_vao.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/text.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/texture.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/transform.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vao_factory.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec2.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec2_array.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec3.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec3_array.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec4.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/vec4_array.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/__init__.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/__main__.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/__main__.py.backup +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/base_webgpu_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/custom_shader_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/instanced_geometry_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/line_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/pipeline_factory.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/pipeline_shaders.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/point_list_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/point_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/triangle_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/webgpu_widget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/REFACTORING_SUMMARY.md +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/UNIFIED_SYSTEM.md +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/buffer_manager.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/pipeline_config.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/shader_constants.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/shader_templates.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/unified_examples.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/unified_factory.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/webgpu/wip/unified_pipeline.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/NGLDebug.log +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/__init__.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/__main__.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/glsl/phong.frag +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/glsl/phong.vert +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/glsl/picking.frag +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/glsl/picking.vert +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/lookatwidget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/mat4widget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/rgbacolourwidget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/rgbcolourwidget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/transformwidget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/vec2widget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/vec3widget.py +0 -0
- {ncca_ngl-0.5.0 → ncca_ngl-0.5.2}/src/ncca/ngl/widgets/vec4widget.py +0 -0
|
@@ -40,7 +40,7 @@ from .simple_vao import SimpleVAO
|
|
|
40
40
|
from .text import Text
|
|
41
41
|
from .texture import Texture
|
|
42
42
|
from .transform import Transform, TransformRotationOrder
|
|
43
|
-
from .util import PerspMode, calc_normal, clamp, frustum, lerp, look_at, ortho, perspective
|
|
43
|
+
from .util import PerspMode, calc_normal, clamp, frustum, lerp, look_at, ortho, perspective, renderman_look_at
|
|
44
44
|
from .vao_factory import VAOFactory, VAOType
|
|
45
45
|
from .vec2 import Vec2
|
|
46
46
|
from .vec2_array import Vec2Array
|
|
@@ -110,4 +110,5 @@ all = [
|
|
|
110
110
|
FirstPersonCamera,
|
|
111
111
|
PySideEventHandlingMixin,
|
|
112
112
|
PerspMode,
|
|
113
|
+
renderman_look_at,
|
|
113
114
|
]
|
|
@@ -161,3 +161,56 @@ def hash_combine(seed, h):
|
|
|
161
161
|
seed = (seed + 0x9E3779B9 + ((seed << 6) & 0xFFFFFFFFFFFFFFFF) + (seed >> 2)) & 0xFFFFFFFFFFFFFFFF
|
|
162
162
|
seed ^= h
|
|
163
163
|
return seed
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def renderman_look_at(eye, look, up):
|
|
167
|
+
"""
|
|
168
|
+
Calculate 4x4 matrix for RenderMan camera lookAt
|
|
169
|
+
Accounts for RenderMan's right-handed Y-down, Z-forward coordinate system
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
eye: Vec3 - camera position
|
|
173
|
+
look: Vec3 - point to look at
|
|
174
|
+
up: Vec3 - up vector (typically (0, 1, 0) in world space)
|
|
175
|
+
|
|
176
|
+
Returns:
|
|
177
|
+
Mat4 - 4x4 transformation matrix
|
|
178
|
+
"""
|
|
179
|
+
# Calculate view direction (from eye to look point)
|
|
180
|
+
n = look - eye
|
|
181
|
+
n.normalize()
|
|
182
|
+
|
|
183
|
+
# Calculate right vector
|
|
184
|
+
up.y = -up.y
|
|
185
|
+
v = n.cross(up)
|
|
186
|
+
v.normalize()
|
|
187
|
+
|
|
188
|
+
# Recalculate orthogonal up vector
|
|
189
|
+
u = v.cross(n)
|
|
190
|
+
u.normalize()
|
|
191
|
+
|
|
192
|
+
# Build the matrix for RenderMan's coordinate system
|
|
193
|
+
# RenderMan uses Y-down, Z-forward
|
|
194
|
+
result = Mat4.identity()
|
|
195
|
+
|
|
196
|
+
# Right vector (X-axis)
|
|
197
|
+
result.m[0][0] = v.x
|
|
198
|
+
result.m[1][0] = v.y
|
|
199
|
+
result.m[2][0] = v.z
|
|
200
|
+
|
|
201
|
+
# Up vector (Y-axis) - negated for Y-down convention
|
|
202
|
+
result.m[0][1] = -u.x
|
|
203
|
+
result.m[1][1] = -u.y
|
|
204
|
+
result.m[2][1] = -u.z
|
|
205
|
+
|
|
206
|
+
# Forward vector (Z-axis) - camera looks down +Z
|
|
207
|
+
result.m[0][2] = n.x
|
|
208
|
+
result.m[1][2] = n.y
|
|
209
|
+
result.m[2][2] = n.z
|
|
210
|
+
|
|
211
|
+
# Translation (camera position)
|
|
212
|
+
result.m[3][0] = -eye.dot(v)
|
|
213
|
+
result.m[3][1] = -eye.dot(u) # Negated Y component
|
|
214
|
+
result.m[3][2] = -eye.dot(n)
|
|
215
|
+
|
|
216
|
+
return result
|
|
@@ -8,14 +8,20 @@ while allowing dimension-specific behavior through abstract methods.
|
|
|
8
8
|
import ctypes
|
|
9
9
|
import math
|
|
10
10
|
from abc import ABC, abstractmethod
|
|
11
|
-
from typing import Any, ClassVar, Self, Tuple
|
|
11
|
+
from typing import Any, ClassVar, Generic, Self, Tuple, TypeVar
|
|
12
12
|
|
|
13
13
|
import numpy as np
|
|
14
14
|
|
|
15
15
|
from .util import clamp, hash_combine
|
|
16
16
|
|
|
17
|
+
# Note this has been changed so I can use python 3.11
|
|
18
|
+
# as renderman want this. Once >3.11 is used we can get rid and just use
|
|
19
|
+
# class VectorBase[T](ABC):
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
T = TypeVar("T", bound="VectorBase")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class VectorBase(ABC, Generic[T]):
|
|
19
25
|
"""
|
|
20
26
|
Base class for all vector types providing common functionality.
|
|
21
27
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|