|
|
|
|
|
by DougWebb
4314 days ago
|
|
That would be really cool. The mathematics involved don't seem too difficult; you have to add another axis to your vectors, points, and transform matrices, and you can place and orient your models in 4D space, set up lights and a camera in 4D space, and project the camera's view into 3D space first then onto the 2D display. I think the hard part is creating the models and writing the rendering engine. Creating 4D models, rather than just putting 3D models into 4D space, would be hard to wrap your head around. And the tools, both for world creation and for rendering, are almost certainly limited to 3D so you'd have to write your own tools for everything. No more GPU acceleration, unless your 4D to 3D transformation creates models and textures on-the-fly to pass to the GPU. |
|
For simplicity, my rendering engine is a dead-simple raytracer which doesn't even bother with reflections- just cast rays and record the first surface they run into. Handling rotations and projections is really easy, but there are two problems I have found:
1. It's just really frickin' slow. Raytracing just ain't fast enough, though I may be able to find some additional optimizations to make it better.
2. In terms of gameplay, navigating the space is really, really hard. It is so easy to get completely lost regarding which direction you're facing and what hyperplane you're on when you can make arbitrary rotations in all four dimensions. It might be something I could get used to, but so far I feel like it's practically necessary to have some mechanism that will snap you back into alignment with some set of gridlines.