Home
 

Simon's Diary...

About Recent Entries

Another reply to ingaborg Aug. 3rd, 2004 @ 10:30 am
Euler's and gimbal lock.

Yup - all the time it seems - but not my problem at the moment - not until I try to produce an animation file anyway...

M$ and quaternions and euler's

I doubt it - there's a standard formula to convert a euler into a rotation matrix - a few sin and cos here and there, but basically very simple. (here) My guess is they use that.

Rotation sucks

Ok, I understand, everyone thinks about rotation in different ways, which is why there are so many ways to define one.

Me, I just want to be able to convert one file format to another with as little loss of information as possible.  And the file format I'm converting to uses Eulers, so I guess I have to.... (although it uses quats internally for slerp. argh. why did I ever start... )

Reply to ingaborg Aug. 3rd, 2004 @ 09:53 am
I'm not really doing anything with it - I'm trying to decode a 3D file format that contains animation - probably stored as a mixture of euler's and quaternions etc, so I thought I really ought to start learning about the maths behind it, so I can hopefully recognise the various parts of the file.

Currently I understand vertexes (yes, I know), faces, normals, textures, meshes, vertex colours, and a few other boring things, but am hoping to expand my knowledge - so I'm doing a basic self-taught self-found out thing about 3D graphics.

The only decent maths library I've found uses 4 coords to represent 3D space, so that's what started me off on that.  Quaternion's seem ok, but for the sake of a bit of extra storage, I think I'd prefer everything to be stored as matrices.  Much simpler, and often implemented in hardware... although possibly less easy to visualise...


Reply posted here, as for some reason, it won't let me post replies, only new entries??

Euler's Aug. 3rd, 2004 @ 09:16 am
A Euler rotation or a Euler Angle or an XYZ bezier is a way of defining any rotation of one object around another using a series of three angles.

There angles are (order may vary according to the implmentation!!!)

The amount to rotate around the X-axis, The amount around the Y-axis and finally the Z-axis.

It seems there is a therom by Euler which states that any rotation may be defined thus, and so the name!

They are relatively easily transformed into a rotation matrix by hand, or the re is the wonderful Direct3D maths library to do all the hard work for me....

D3DXMatrixRotationYawPitchRoll( D3DXMATRIX* pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll )

Now isn't that nice!

I knew microsoft were good for something.

More on 3D... Aug. 3rd, 2004 @ 08:46 am
OK, figuring it out slowly...

4 coordinate systems for 3D graphics.

This adds a fouth coordinate "w" to the usual (x, y, z) triple to produce (x, y, z, w).
The fourth coordinate is a "scale" variable.

Let me explain, (x, y, z) in a 3 coordinate system would normally map to (x, y, z, 1.0) in a 4 coordinate system, and (x, y, z, w) would map to ( x/w, y/w, z/w ) going the other way.

Thing to notice -

(x, y, z, w) is equivalent to ( n x, n y, n z, n w ) for any real number n.
This is only defined for positive values of 'w' and may cause problems with negative values.

The next question is WHY bother?

OK, the basic reason is to simplify coordinate manipulation.

Instead of having to multiple by one sized matrix (3x3) to get a rotation and add a different sized matrix (3x1 or is that 1x3?) to get translation, or multiple by a scaler ( or a matrix (3x3) ) to scale, any operation, including a combination of translate, scale and rotate may be done by multiplying the coordinates by a 4x4 matrix.

Example: Translation:

    1 0 0 dx
    0 1 0 dy
    0 0 1 dz
    0 0 0 1

This matrix mill change ( x, y, z, 1.0 ) into ( x + dx, y + dy, z + dz, 1.0 ) thus giving a simple translation.

And as matrix multiplication is cummalative? (ignores brackets - A(BC) = (AB)C) even if it isn't associative (AB != BA) you can precalculate a single matrix to produce any movements you require.

OK - so simplification of transformations. Seems a good reason to bother to me.

More in your handy 3D maths tutorial soon...

I Hate 3D graphics. Aug. 2nd, 2004 @ 04:42 pm
Well sort of....

I'm actually enjoying myself at the moment, trying to dig around in a numerous files trying to work out what every little bit in them does.

Doesn't help that I know next to nothing about 3D graphics (the files represent a full blown 3D object  including animation, particle effects, textures, UV maps, cameras, lighting - you name it, it seems to be in there.)

Takes me back to the good old days of the Vic-20 and C-64...


So, current project is find out about animation using keyframes and bones and joints and skeletons.

And to find out about 3D graphic basics such as matrix transformations, 4 co-ordinate 3D systems, Quaternion's, Euler's  etc.

Currently trying to figure out what transformations can be specified by...

a 4 float matrix
a 7 float matrix (two different kinds of these!)
a 3 float matrix
a 6 float matrix
a 9 float matrix
a 1 float matrix
a 4 float matrix
a 2 float matrix

Not getting particularyly far so far... but I have hope....

PS - anyone with access to 3DS MAX 4.2 out there?  I could do with a few little files being models and animated.... won't take long - promise....
Other entries
» Boring boring boring
OK, another day, another dollar.

Working from home again, so I can actually do some work, rather than not want to cos of all the stuff I did at home over the last week but not yet taken to work.

Working through the rather large ammounts of errors that come from attempting to "black box" something that wasn't black boxed from the start.

Down to 30 unresolved symbols from the rearrangement, plus a dozen or so functions not properly declared, cos I'm not sure where they're going to go.

Oh well, back to the grind....
» Missing my computer
OK, silly me.

Worked from home for the past few days ( partiially because I was ill, but...)
And guess what - I left my laptop at home, meaning that the five days worth of work are at home, and there's a lot to do, but not much I want to do until I've intergrated the stuff I did at home....

Grrrr  ARG  (as they say)

So, today I'm sorting an array of strings according to there position in another array.

Oh, what fun.
» Working from home today....
Not feeling brilliant today, so not going in to work.

Will instead work from home... now I have to write a routine to part (maybe all) of one array according to data in a second array. Each item in the second array is a list of items which "may" be in the first array.

Items in the first array should stay in the order they are initially within the groupings of the second array.  Any item not in any group of the second array should be moved to the end of the first array.

Sounds simple to me! But very boring....

Oh well...
» I Hate internet explorer
CSS style sheet problem found and solved - internet explorers temporary file space was full, so style sheets started working "intermittantly"...  ARGH

I'll say that once more...  ARGH

One day microsoft will do something right...
» (No Subject)
OK, me again....

Gave up on the deep complicated structures, now using an array of strings and an array of bools...
well, at least its quick....

now all I've got to do is work out why my style sheets only work some of the time, and not others...
» (No Subject)
3:20 - End of the working day..... Going home now....

Look, I was in at 7:30...

Anyway, now puzzling about organising things into groups and displaying them in a hierachical display.  Somehow.

Displaying them isnt' the problem for once. The underlying data structures weren't designed for this and as such suck. (and yes, I did write them).  I don't want to have to change it all though. So must think through what I need to do.

Argh.
» (No Subject)
OK, time for some whittering I guess.

My first entry to livejournal.  Exciting isn't it!

Well, as you can see, not in hospital at the moment although I should be... They tell me I'm too ill.  Too ill!  That's why I went to hospital in ther first place.  Anyway, they say come back in a month or so and we might do something. Maybe. Ah well....

What else can I say...
Last week saw the end of a successful panto run - I played Riff half of one of the comedy duos (don't ask) in an interpretation of Ali Baba.

Enough for now... more later....

Advertisement

Top of Page Powered by LiveJournal.com