-
Notifications
You must be signed in to change notification settings - Fork 155
How do I render the outline of a cube? #196
Comments
Your code works https://jsbin.com/sejekal/edit?html,js,output |
Yeah right, but how do I implement this with R3R? 🤣 <lineSegments>
<edgesGeometry>
<bufferGeometry>
<boxGeometry {...props} />
</bufferGeometry>
</edgesGeometry>
<lineBasicMaterial>
</lineSegments> But the edgesGeometry merely takes a |
Ahhh that makes a lot more sense! Didn't check which repo I was in, need my morning coffee haha... |
Haha - I know that feeling. If you're finished I'd be so damn thankful I you could give me helping hand here :D |
Well as you asked so nicely I had a quick attempt, and now I see what you mean! I haven't worked on this project in months so I'm really rusty with it. My workaround was const geometry = new THREE.BoxBufferGeometry( 1,1,1 );
...
<edgesGeometry geometry={geometry} /> but clearly that's not an ideal solution. I'll mess around with it a bit more and will try to post something here if I get anywhere with it/you don't get any better answers in the meantime. Good luck! |
Thanks @johnrees! if (!props.geometry && props.children && props.children.length === 1) {
return new THREE.bufferGeometry(props.children[0]())
} P.S. Lemme know if I should drop a PR on that matter :) |
Apologies for responding late, PRs are always welcome! For now the workaround is necessary until we can merge a proper fix in (or the next version is out and "magically takes care of it" :P) |
It would be good if a PR also supports |
Forgive me for that trivial question but I've been trying to wrap my head around this for almost an hour now. If I recall correctly, I can create a vanilla threejs edge geometry like so:
The docs don't really explain how I am supposed to compose my components so that this works. It says that edgesGeometry needs a geometry attribute, but when I pass one, I get an error.
Could anyone help me out real quick?
Cheers
The text was updated successfully, but these errors were encountered: