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

Line color not working #337

Closed
Methuselah96 opened this issue Jan 15, 2024 · 2 comments · Fixed by #338
Closed

Line color not working #337

Methuselah96 opened this issue Jan 15, 2024 · 2 comments · Fixed by #338
Labels
bug Something isn't working released

Comments

@Methuselah96
Copy link
Contributor

Methuselah96 commented Jan 15, 2024

  • three version: any
  • @types/three version: any
  • three-stdlib version: 2.29.0 and 2.29.1

Problem description:

Setting the color of a Line seems to no longer work with drei, presumably caused by #335 either directly or indirectly.

Relevant code:

import { Vector3 } from 'three'
import { Canvas } from '@react-three/fiber'
import { Line, OrbitControls } from '@react-three/drei'
import { GeometryUtils } from 'three-stdlib'

const points = GeometryUtils.hilbert3D(new Vector3(0), 5).map((p) => [p.x, p.y, p.z])

function BasicLine() {
  return <Line points={points} color="red" lineWidth={3} />
}

export default function App() {
  return (
    <Canvas>
      <ambientLight intensity={Math.PI / 2} />
      <spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} decay={0} intensity={Math.PI} />
      <pointLight position={[-10, -10, -10]} decay={0} intensity={Math.PI} />
      <BasicLine />
      <OrbitControls />
    </Canvas>
  )
}

CodeSandbox

Suggested solution:

?

@Methuselah96 Methuselah96 added the bug Something isn't working label Jan 15, 2024
@CodyJasonBennett
Copy link
Member

Likely multiplied by 0 (or initial values) when vertex colors aren't specified.

Copy link

🎉 This issue has been resolved in version 2.29.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants