question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XYZLoader not loading colours

See original GitHub issue

Describe the bug

When importing an XYZRGB point cloud, the pixels are all white instead of the expected colors.

The XYZLoader seems to be loading the values, and setting the colours, including calling geometry.setAttribute correctly, but the WebGLRenderer isn’t rendering the particles with their values.

To Reproduce

Steps to reproduce the behavior:

• Update the helix_201.xyz file to include RGB values after the XYZ values on each line: • Load the XYZ file using the XYZLoader • See that all the XYZ coordinates are white!

Code

helix_201.xyz with RGB values (all purple): https://github.com/elliottkember/three.js/blob/elliottkember-xyz-rgb/examples/models/xyz/helix_201.xyz

image

Loader implementation:

  const loader = new XYZLoader();
  loader.load("./helix.xyz", function (geometry) {
    geometry.center();

    const material = new THREE.PointsMaterial({ size: 0.1 });

    points = new THREE.Points(geometry, material);
    scene.add(points);
  });

Live example

https://elliottkember.github.io/three.js/examples/webgl_loader_xyz.html

Expected behavior

The dots should all be purple.

Screenshots

image

image

Platform:

  • Device: Desktop
  • OS: MacOS
  • Browser: Chrome
  • Three.js version: 123

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
elliottkembercommented, Dec 16, 2020

I figured it out!

The example file has:

const material = new THREE.PointsMaterial( { size: 0.1 } );

What I needed was:

const material = new THREE.PointsMaterial( { size: 0.1, vertexColors: THREE.VertexColors } );

0reactions
mrdoobcommented, Dec 16, 2020

Yeah, I think that works 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

loader - XYZLoader Example in three.js not working locally
The expected output is: https://threejs.org/examples/?q=xyz#webgl_loader_xyz But my output is a empty canvas. Can anyone help me with this issue ...
Read more >
MelonLoader Wiki
MelonLoader. The World's First Universal Mod Loader for Unity Games. Supports Il2Cpp and Mono games; Made and used by multiple game communities.
Read more >
Problem with my RCM Loader | GBAtemp.net
I think I didn't load the files on my SD card the first time trying and after that it just stays blue. Any...
Read more >
How To Use RCM Loader For Injecting Payloads - YouTube
Support my Channel by using Youtube Super Thanks or donating to my PayPal account: https://www.paypal.me/HoodieWe4therBuy: ...
Read more >
[Release] Genshin XYZ - Page 51 - UnKnoWnCheaTs
Page 51 - Genshin XYZ - Genshin Impact Hacks and Cheats Forum. ... i really wanna told u guys that the player tabs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found