ripe-tech / ripe-sdk

The public Javascript SDK for RIPE Core
https://www.platforme.com
Apache License 2.0
8 stars 4 forks source link

#429 Loading CSR based on spec #427

Closed NFSS10 closed 1 year ago

NFSS10 commented 1 year ago
- -
Issue https://github.com/ripe-tech/ripe-sdk/issues/429
Dependencies - https://github.com/ripe-tech/ripe-sdk/pull/431
- https://github.com/ripe-tech/ripe-docs/pull/625
Decisions - Move core CSR initialization logic to on post_config event instead of just on the first init
- Update which values should be updated by the configurator and which values should be updated by the config
- Allow to choose between asynchronously and synchronously setup

https://user-images.githubusercontent.com/22588915/207101956-b9c1dcf8-1c38-4dfb-b8d8-46b198478aaa.mp4

Test config used for testing this feature (just adds it to the start of _onPostConfig():

const specInitials = {
            "3d": {
                ...(config.initials["3d"] || {}),
                width: 3000,
                height: 300,
                font_size: 280,
                stoke_width: 5,
                text_displacement_blur: 1.5,
                text_normal_map_blur: 1,
                points: [
                    [-1, 0, 0],
                    [0, 0, -1],
                    [1, 0, 0]
                ],
                position: [0, 0, 0],
                rotation: [0, 0, 0],
                scale: 1,
                material_color: "ffffff",
                material_metalness: 0,
                material_roughness: 1,
                material_emissive_color: "000000",
                material_emissive_intensity: 1,
                material_displacement_scale: 25,
                material_displacement_bias: 0,
                mesh_width_segments: 1000,
                mesh_height_segments: 100
            }
        };
        const spec3d = {
            scene: {
                environment: "studio_small_2",
                tone_mapping: "aces_filmic",
                tone_mapping_exposure: 0.8,
                camera: {
                    position: [0, 0, 207],
                    rotation: [0, 0, 0],
                    fov: 24.678,
                    film_gauge: 35,
                    aspect: 1,
                    near: 0.1,
                    far: 10000
                },
                camera_look_at: [0, 0, 0],
                zoom: {
                    enabled: true,
                    min: 0.75,
                    max: 1.5,
                    sensitivity: 1
                }
            }
        };
        config.initials = { ...config.initials, ...specInitials };
        config["3d"] = spec3d;
joamag commented 1 year ago

@NFSS10 let's schedule a meeting to start the discussion of the spec adaption

joao-conde commented 1 year ago

@NFSS10 fix new conflicts please