Skip to content

Placement of Point cloud in scene #127

Open

Description

@bjornsyse

Hi

It seems the rendering of my pointcloud is not honoring the transform values, and I can't control where in the scene it's renderered. Is this expected behaviour?

image

Activity

  1. unitycoder commented on Jan 14, 2022

    @unitycoder
    Owner

    yes thats the default way (for v1/v2 (.bin, .ucpc) viewer there are shaders with offset variable to translate cloud,
    and in next version there is shader that enables transform follow (pos, rot, scale), but for v1/v2 formats.

    V3 tiles format is bit different, as its tile based, cannot move points, unless update all tile culling positions also..
    i can check if that gets complicated/slow.. ill reply here.

    current "workaround" could be adding manual -offset to cloud during conversion.. but of course not very useful.

  2. RjMelter commented on Jan 14, 2022

    @RjMelter

    another workaround could be a script that changes all of those variables in the tiles and the root file. Seems like it would be pretty easy since the root file contains the locations of all files yes?

    Ex. NewOffset = xyz.
    `for(int i = 0; i < tile.count; i++)
    {

    byte[] = file.readAllBytes(path);
    byte[pos+t] = x;
    byte[pos+t+sizeof] = y;
    byte[pos+t+sizeof] = z;
    file.delete(path).
    file.OpenWrite(path).
    }`
    etc

  3. unitycoder commented on Jan 14, 2022

    @unitycoder
    Owner

    yes, that would be possible (maybe faster than converting again, at least for large clouds)..
    but then again, iterating hundreds of files wouldnt be too fast either.. (at least if need to move transform many times)

    so at that point, easier to add method that offsets loaded point data, re-inits cloud.

    v3 data formats are described here, its just raw point data:
    https://github.com/unitycoder/UnityPointCloudViewer/wiki/Binary-File-Format-Structure#custom-v3-tiles-pcroot-and-pct-rgb

  4. RjMelter commented on Jan 14, 2022

    @RjMelter

    Well If you ever make a binary version Can it look like this? xD It would make it very easy to manipulate the data if the files were in binary vs ascii. the conversion takes more time than its worth. Would be easier just to create a viewer for people who want to read the files.
    image

  5. bjornsyse commented on Jan 17, 2022

    @bjornsyse
    Author

    Ah ok. I was not aware at all. It seems this makes it quite not so usefull at all for my purposes then. But you're saying there are offset values in the V2 version. Perhaps I'll go that route for now, then but I'd have to completely decimate my pointcloud in that case. Or perhaps re-convert LAS-file with offset values, that could possibly work aswell. Thanks for info! Hoping for the next version then.

  6. bjornsyse commented on Jan 17, 2022

    @bjornsyse
    Author

    On a side note, is this something that could be of interest for this plugin?

    https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@12.0/manual/whats-new-12.html

    image

  7. unitycoder commented on Jan 17, 2022

    @unitycoder
    Owner

    if you send me an email, i can attach the v2 translation shader version for testing.

    for v3 tiles:
    Is it enough to move it during Start() to match transform pos, or you'd like to move it dynamically during playing also?

    VFX, noticed that feature but haven't tested yet.. i'll put it big higher on the test list, to see if its useful. (not sure how it would play with tiles version & culling system though. but for single cloud(s) should certainly work)

  8. bjornsyse commented on Jan 18, 2022

    @bjornsyse
    Author

    Thanks! I sent you an email.

    about the v3 tiles question, I really think for most cases Start() adjustment would be sufficient. At least for the use cases I imagine for my own projects.

  9. unitycoder commented on Oct 18, 2023

    @unitycoder
    Owner

    made initial tests for this issue,
    works if manually loop & offset loaded points, but that would be slow..
    so it needs custom shader that offsets points too.

    this should work, so i expect it to come in the next update.

  10. unitycoder commented on Oct 19, 2023

    @unitycoder
    Owner

    ok, it works for the basic v3 viewer, not packed version yet..
    offset is applied on start and then possibly can be edited later from script too.
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions