Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement of Point cloud in scene #127

Open
bjornsyse opened this issue Jan 14, 2022 · 10 comments
Open

Placement of Point cloud in scene #127

bjornsyse opened this issue Jan 14, 2022 · 10 comments

Comments

@bjornsyse
Copy link

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

@unitycoder
Copy link
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.

@Rickmc3280
Copy link

Rickmc3280 commented Jan 14, 2022

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

@unitycoder
Copy link
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

@Rickmc3280
Copy link

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

@bjornsyse
Copy link
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.

@bjornsyse
Copy link
Author

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

https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-12.html

image

@unitycoder
Copy link
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)

@bjornsyse
Copy link
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.

@unitycoder
Copy link
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.

@unitycoder
Copy link
Owner

unitycoder commented Oct 19, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants