Hyper-spacial ray-tracer

  • Thread starter Rouslan Korneychuk
  • Start date
R

Rouslan Korneychuk

I have been working on something I thought was interesting and I wanted
to know what other people think. It's a ray-tracing library than can
work with any number of spacial dimensions greater than two. It's a
Python package that uses Pygame.

The project and a screenshot are at: https://github.com/Rouslan/NTracer

For those not familiar with the concept of hyper-space: a simple example
of a three-dimensional object is a cube. A two-dimensional analogue is a
square. With one dimension, it would be a line (and with zero
dimensions, a point). Although our universe only has three spacial
dimensions (ignore theoretical physics for a moment), there is actually
no reason why it can't be any other number, and so you can go the other
way. A four-dimensional analogue of a cube is a tesseract, and when
generalized for any number of dimensions it's called a hypercube.

Of course, it's really hard to imagine anything with more than three
dimensions, which is precisely why I wrote this library. The screenshot
in the link shows a three-dimensional cross-section of a six-dimensional
hypercube at a particular angle. So far, all the library can draw is a
scene with one hypercube (although you can position the camera anywhere
you want), but I'm planning to add support for complex scenes where you
can put various kinds of shapes with arbitrary transformations and
materials (color and opacity at least).
 
R

Rouslan Korneychuk

Sorry, but that sounds awful. I hate games.

This... isn't a game or even related to gaming. Is it because of the use
of Pygame that you thought it was. I use Pygame because it's a wrapper
for SDL, which gives you cross-platform graphics, input and even thread
support, and because the additional drawing and font modules are useful
for prototyping and implementing user-interfaces for navigating
higher-dimensional space.

The point of this was to explore the concept of hyperspace, which is a
mathematical curiosity and also has relevance in theoretical physics.

One idea I had for this was to simulate some sort of 3D scene involving
physics (probably in another program, such as Blender), take the
resulting coordinates of the geometry at every time interval and plot it
as one 4D static scene. Every pair of connected vertexes would be
extruded from one instant in time, to the next, so each object is a
continuous 4D extrusion. When viewing with your local XYZ axes aligned
with the global XYZ axes, you would see one instant of the scene as
normal. Moving along the fourth axis, which I'll call T, will let you
see the same, earlier or later in time, but if you rotate parallel to
the T axis, you will effectively replace one of X, Y or Z with T. In
essence you will turn the time axis into a spacial axis and the spacial
axis into a time axis.

Looking at a scene with space and time lumped into one 4D space might
help in trying to better understand time, why it's different, and its
relationship with space.

I was also wondering about general relativity. I'm not going to go into
too much detail, but basically: if an object with synchronized clocks on
either end of it, passes by a static observer while traveling near the
speed of light, to the outside observer, the object will appear shorter
and the clocks will appear desynchronized, and from the object's
perspective, it is the outside observer that becomes distorted this way.
I was wondering if this seemingly strange effect is actually the natural
consequence of a simple geometric transformation, such as rotation into
the time axis.
 
C

Chris Angelico

The point of this was to explore the concept of hyperspace, which is a
mathematical curiosity and also has relevance in theoretical physics.

I don't have any actual use-case for what you've done, but it sure
sounds cool! Having worked with 3D ray-tracing (with POV-Ray), I'm
slightly in awe of the possibility of going to ten dimensions... yup,
cool!

ChrisA
 
R

Rouslan Korneychuk

I don't have any actual use-case for what you've done, but it sure
sounds cool! Having worked with 3D ray-tracing (with POV-Ray), I'm
slightly in awe of the possibility of going to ten dimensions... yup,
cool!

Thanks. For a while, I was worried nobody else thought it was interesting.

It's funny that you say that about ten dimensions, considering I was
thinking I should add scroll bars to the example script so the controls
don't get cut off when going to 100 dimensions.
 
8

88888 Dihedral

This... isn't a game or even related to gaming. Is it because of the use

of Pygame that you thought it was. I use Pygame because it's a wrapper

for SDL, which gives you cross-platform graphics, input and even thread

support, and because the additional drawing and font modules are useful

for prototyping and implementing user-interfaces for navigating

higher-dimensional space.



The point of this was to explore the concept of hyperspace, which is a

mathematical curiosity and also has relevance in theoretical physics.



One idea I had for this was to simulate some sort of 3D scene involving

physics (probably in another program, such as Blender), take the

resulting coordinates of the geometry at every time interval and plot it

as one 4D static scene. Every pair of connected vertexes would be

extruded from one instant in time, to the next, so each object is a

continuous 4D extrusion. When viewing with your local XYZ axes aligned

with the global XYZ axes, you would see one instant of the scene as

normal. Moving along the fourth axis, which I'll call T, will let you

see the same, earlier or later in time, but if you rotate parallel to

the T axis, you will effectively replace one of X, Y or Z with T. In

essence you will turn the time axis into a spacial axis and the spacial

axis into a time axis.



Looking at a scene with space and time lumped into one 4D space might

help in trying to better understand time, why it's different, and its

relationship with space.



I was also wondering about general relativity. I'm not going to go into

too much detail, but basically: if an object with synchronized clocks on

either end of it, passes by a static observer while traveling near the

speed of light, to the outside observer, the object will appear shorter

and the clocks will appear desynchronized, and from the object's

perspective, it is the outside observer that becomes distorted this way.

I was wondering if this seemingly strange effect is actually the natural

consequence of a simple geometric transformation, such as rotation into

the time axis.

Use the synchronous digital logics
with a globbal clock by iterators of
various actions for this kind of
projects in Python.

Please check myHDL and Python.
auto-
 
P

Peter Pearson

I was also wondering about general relativity. I'm not going to go into
too much detail, but basically: if an object with synchronized clocks on
either end of it, passes by a static observer while traveling near the
speed of light, to the outside observer, the object will appear shorter
[snip]

That's special relativity, not general relativity. Python is
very sensitive to that distinction.
 
R

Rouslan Korneychuk

I was also wondering about general relativity. I'm not going to go into
too much detail, but basically: if an object with synchronized clocks on
either end of it, passes by a static observer while traveling near the
speed of light, to the outside observer, the object will appear shorter
[snip]

That's special relativity, not general relativity. Python is
very sensitive to that distinction.

whoops
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top