TE
ТехЭхо
ГлавнаяТоп за 24 часаНовейшиеЛучшиеВопросыПоказатьВакансии
GitHubTwitter
Главная

ТехЭхо

Платформа технологических новостей, созданная с использованием Next.js, предоставляющая глобальные технологические новости и обсуждения.

GitHubTwitter

Главная

ГлавнаяНовейшиеЛучшиеВопросыПоказатьВакансии

Ресурсы

HackerNews APIОригинальный HackerNewsNext.js

© 2025 ТехЭхо. Все права защищены.

Show HN: Curved Space Shader in Three.js (via 4D sphere projection)

68 балловавтор: bntr3 дня назад
I made a GLSL shader that bends 3D space using a 4D hypersphere projection.<p>The idea:<p><pre><code> 1. Project a model onto a 4D sphere 2. Rotate the sphere 3. Project the model back to 3D </code></pre> Code and details: <a href="https:&#x2F;&#x2F;github.com&#x2F;bntre&#x2F;CurvedSpaceShader">https:&#x2F;&#x2F;github.com&#x2F;bntre&#x2F;CurvedSpaceShader</a><p>Curious what you think.

12 comments

meta-meta3 дня назад
Nice! My partner predicted this in some album art she did for a friend. <a href="https:&#x2F;&#x2F;badbraids.bandcamp.com&#x2F;album&#x2F;supreme-parallel" rel="nofollow">https:&#x2F;&#x2F;badbraids.bandcamp.com&#x2F;album&#x2F;supreme-parallel</a>
talkingtab3 дня назад
While the demo is great, and the 4D stuff is very cool, for me the amazing thing is the code to do this. Three.js opens a door to using webgl &amp; webgpu, and shaders open yet more doors.
saltwatercowboy3 дня назад
Very cool. Have you tried applying it to a cube sphere&#x2F;are the results are contiguous? I&#x27;d be interested in incorporating it into a hybrid planetary science&#x2F;storymapping project I&#x27;m working on.
评论 #44062047 未加载
jimmySixDOF3 дня назад
For anyone interested in exploring Godot are working on a json spec for 4D Shapes for rendering and physics -- it&#x27;s called G4MF (Good 4D Model Format) loosely based on Khronos glTF -- still a work in progress but there is playground editor support for x&#x2F;y&#x2F;z&#x2F;w<p><a href="https:&#x2F;&#x2F;github.com&#x2F;godot-dimensions&#x2F;g4mf">https:&#x2F;&#x2F;github.com&#x2F;godot-dimensions&#x2F;g4mf</a>
评论 #44069875 未加载
tasoeur3 дня назад
I wonder if there’s something interesting visually if this shader could be explored immersively (VR). Could be worth prototyping it on my little app :-) (<a href="https:&#x2F;&#x2F;shader.vision" rel="nofollow">https:&#x2F;&#x2F;shader.vision</a>).
评论 #44062568 未加载
ivanjermakov3 дня назад
Because transformation happens in the vertex shaders, curvature would not work on low-poly objects. For this reason camera distortion is usually implemented in clip space (only after non-distorted frame is ready)
评论 #44063607 未加载
tetris113 дня назад
I like it as a curiousity, but it only makes sense to me if I think of it 2D scene to 3D sphere.<p>Is 4D sphere the upper limit on this method, or can you project say 3D scene onto 5D sphere? (e.g a 1D line onto a 3D sphere analog)
评论 #44061714 未加载
fallinditch3 дня назад
Good job, a lovely idea! It reminds me of AI morphing animation, I wonder if these techniques can be combined...
bobsmooth3 дня назад
God I wish I could understand 4D geometry.
Sourabhsss13 дня назад
This is interesting...
Duanemclemore3 дня назад
This is rad. The game is especially cool. Congrats, OP!<p>This is the same math as this old program called Jenn3d[0] which I played around with almost twenty years ago. (Amazingly the site is still online!) The crazies who built it also built it to play Go in 3d projective space. I was never able to play Go with it, but I&#x27;ve been in to projective geometries since.<p>OP - if you want to try something else cool with 4d to 3d projective geometries, here&#x27;s an idea I ran across working with 3d to 2d.<p>I make a tool for generating continuous groupings of repetitive objects in architectural computation. [1] When faced with trying to view the inside of lattices containing sets of solids which tile space continuously, I tried a few different methods (one unsuccessful but cool looking one here [2])<p>So when I created the sphere upon which to project the objects in the lattice, rather than just project the edges I made concentric spherical section planes and projected the intersection of those with the objects. [3] By using objects parallel to the projection plane to cut sections I was able to generate spacings between the final generated section lines that mapped how oblique the surface being cut was from the ray projecting from the centerpoint of the sphere to its surface.<p>Sorry OP, that&#x27;s a long description. TL;DR - instead of projecting 3d mesh edges to a 4d sphere then back down to 3d space, what if you tried describing the meshes as the intersection of their 3d geometry with 4d hyperspheres parallel to the projection hypersphere? It would look more abstract, but I bet it would look cool as heck, especially navigating in 3d projective space!<p>[0] <a href="https:&#x2F;&#x2F;jenn3d.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jenn3d.org&#x2F;</a> [1] <a href="https:&#x2F;&#x2F;www.food4rhino.com&#x2F;en&#x2F;app&#x2F;horta" rel="nofollow">https:&#x2F;&#x2F;www.food4rhino.com&#x2F;en&#x2F;app&#x2F;horta</a> [2] <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;698774461" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;698774461</a> [3] <a href="https:&#x2F;&#x2F;vimeo.com&#x2F;698774461" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;698774461</a><p>p.s. Also, if any actual geometers are reading this - I&#x27;d love to co-author a math paper that more rigorously considers what I explored &#x2F; demonstrated with the drawings above. I have a whole set of them methodically stepping through the process, and could generate more at will. I also have a paper about it I can send on request (or if you can hunt down the Design Communication Association Conference Proceedings 2022).
评论 #44064354 未加载
qwertox3 дня назад
These projections, how do they make sense?<p>I can project a 3D item onto a 2D plane, but only observe it because I&#x27;m outside of that 2D plane. This is like expecting the 2D plane to see itself and deduce 3D-dimensionality from what it sees. Like a stickman. It would only be able to raycast from its eye in a circle. It could do so from multiple points on the plane, but still, how would it know that it is looking at the projection of a sphere?
评论 #44061914 未加载