Skip to main content

"How do I generate a transform for mapping a regular 3D cube space to irregular "cubish" space?"

2 replies [Last post]
Anonymous

"How do I generate a transform for mapping a regular 3D cube space to irregular "cubish" space?"

I've spent 3 days trying to figure this out, and googled every phrase I can think of, but while I can get close, every solution falls apart as soon as it becomes non-affine.

I want to transform an object contained within the regular space to the space contained within the irregular space. I can define the eight vertices for either space, and the edges of the irregular space are straight lines, but some or all of them may no longer be parallel to one another.

Using the same set of 4 verts to create a 4x4 matrix for each space, then multiplying the goal matrix by the inverse of the starting matrix results in a transform matrix that works as long as both spaces maintain perpendicuarity.

Any links or code will be greatly appreciated!

 
Don Casteel 
 
My Deviant Art Home:     http://casteeld.deviantart.com
My Deviant Art Gallery:    http://casteeld.deviantart.com/gallery/
My Project Home:            https://fractrace.dev.java.net/

[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aces
Offline
Joined: 2003-07-17
Points: 0

Hi Dan

On ShaderX3 book there is a very short article titled "Deforming of Mesh Objects Using HLSL". Of course the ideas over there can be applied to GLSL or even fixed pipeline.
It is just 7 pages about vertex and normal interpolations, centering objects and functions to interpolate it.

This is a per vertex interpolation, I guess is not possible to define a single matrix to deform all points.

aces
Offline
Joined: 2003-07-17
Points: 0

Hi Dan

On ShaderX3 book there is a very short article titled "Deforming of Mesh Objects Using HLSL". Of course the ideas over there can be applied to GLSL or even fixed pipeline.
It is just 7 pages about vertex and normal interpolations, centering objects and functions to interpolate it.

This is a per vertex interpolation, as is not possible to define a single matrix to deform all points.