mrvux / FeralTic

Small utilities wrapper for SlimDX / Direct3D11
5 stars 18 forks source link

Platonic primitives in 4d #19

Closed fibo closed 1 year ago

fibo commented 7 years ago

I would like to have the Penthacoron node in DX11.

I wrote an EX9 version and it uses a transform matrix input pin, see https://github.com/vvvv/vvvv-sdk/blob/develop/vvvv45/addonpack/src/nodes/plugins/Mesh/Penthacoron/Penthacoron.cs#L57

My goal is to have a Penthacoron as a template to then add also the other Platonic 4d solids (I have the points).

Is it possible to start from Tetrahedron adding the input matrix and the corresponding 4d vertices transformed into 3d (I used a projection matrix, see https://github.com/vvvv/vvvv-sdk/blob/develop/vvvv45/addonpack/src/nodes/plugins/Mesh/Penthacoron/Penthacoron.cs#L308)?

Any hint or snippet you can show me please, specially how to add an input matrix and wich functions to multiply a 4d vector ?

Starting with your help I could add the other primitives (Hypercube, 24-cell. 16-cell, 120-cell, 620-cell).

mrvux commented 6 years ago

Functions should be the same, you have * in SlimDX (which is the math backend for dx11)

Normally you have all 3d primitives in there, so I guess tetrahedron is an easy one to start with.

General idea with the runtime is: you have a descriptor (all parameters to build a primitive, see https://github.com/mrvux/FeralTic/blob/master/Core/DX11/Geometry/Primitives/DX11PrimitiveDescriptors.cs)

then you have a function to build primitive : https://github.com/mrvux/FeralTic/blob/master/Core/DX11/Geometry/Primitives/DX11Primitive_Quad.cs

once you get that there are the same templates in nodes to have a 4v counterpart