RE: Hi - just checking

2009-08-07 Thread Simon Cooke
It's still pretty much just a quick sin/cos lookup for the euler angle
calculation. As you say, you just store it in a form that hits 0 at 0, and
2pi - epsilon at 65535. (Or something similar), and then just do a lookup.
That part's fast.

Quaternions... The biggest advantage is that you can interpolate between
them - which is necessary for skeletal animation. There are a number of
disadvantages though - the need to occasionally renormalize them being a big
one. (You're not actually gaining any kind of stability there per se; all
you're doing is trading one numerical inaccuracy for another). 

Here's a case against them:

http://www.gamedev.net/reference/articles/article1199.asp
http://www.somedude.net/gamemonkey/forum/viewtopic.php?f=12&t=380


http://www.sjbrown.co.uk/2002/05/01/quaternions/

Note: it may make sense to handle your camera as a quaternion, vs. a
rotation matrix for local->worldspace transforms, based on the cost of
operations.

If you decompose your matrix into all of the pieces you need to calculate
when you build it, and keep that alongside all of the pieces you need to
apply when you apply it, then you might find more optimization opportunities
- especially if you're not performing more than one rotation at once.

But ultimately, the name of the game here is to go as far as possible, so
it's all going to come down to your use cases.




-Original Message-
From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
Behalf Of Thomas Harte
Sent: Wednesday, August 05, 2009 4:13 PM
To: sam-users@nvg.ntnu.no
Subject: Re: Hi - just checking

They're in some format or another that I don't recall offhand, but is
lined up so that a full circle is a nice round binary number for the
obvious range fixing optimisation. But it's not just a quick sin/cos
table lookup unless you're rotating around one axis only. See, e.g.
http://www.manpagez.com/man/3/glRotatef/ (the man page for glRotatef)
- clearly there's a lot more going on there than table lookups.

Of course, I am taking note of coherences. If the angles associated
with an object do not change from one frame to the next, the source
matrix is not recalculated. This optimisation postdates the version of
my code that has already appeared on Sam Revival, but predates the
next version (which is a better optimised version of the code shown in
my video http://www.youtube.com/watch?v=j0xN_Mi3B_I)

As I've posted to this list in the past, I use something vaguely like
SIMD to multiply a 2d vector by a scalar - the relevant part of the
scalar sits in the accumulator and is shifted there to make the
add/don't add decision in the standard binary multiplication formula,
meanwhile the 2d vector sits with the work going in for one component
occupying BC, DE and HL, the work for the other occupying BC', DE' and
HL'. Hence I get a substantial saving on multiplying the two vector
components by the scalar separately.

Naturally, I have a classic y = f((x^2)/4) table for the limited range
multiplications (related to the maximum size an individual object may
be).

I assume your point about not accumulating transformations in matrices
effectively means that you agree that quaternions are useful beyond
interpolation and animation (which I'm interpreting quite narrowly to
be the traditional skeletal type, not broadly to be any old moving
image).

Anyway, hopefully I'll be able to get myself in gear for a source
release at some point in the near future, then you can rip it apart.
It's all geared up to be trivial for other (assembler) coders to use
to produce their own programs, handling triple buffering and frame
rate compensation with very limited need for work on the part of the
programmer (which neatly means that all my code scales really well
from a normal Sam to a Mayhem or otherwise accelerated machine), etc.
I tidied most of it up for a release quite a while ago but decided to
switch to Jam rather than sticking on pyz80 because a lot of stuff
would be substantially more compact and more readable with proper
macro support. I also would much rather that the demo was seen first
on Sam Revival rather than on the internet, both as a pathetic attempt
to support the publication and because it looks much better on a real
television. Never found time to convert it though, so it'll be a pyz80
release.

Actually, the demo on the previous Sam Revival was explicitly flagged
as PD, so I'll upload a DSK of that demo somewhere once the next
edition is out. I think I mentioned every Sam program I've written in
the SR article; you can see most of them very briefly in
http://www.youtube.com/watch?v=kr_Lz98qVjE&feature=channel_page

On Wed, Aug 5, 2009 at 10:16 PM, Simon Cooke wrote:
> Hmmm... what form are you using your Eulers in? If it's radians, it's not
> too bad - just a quick sin/cos table lookup. And you only need to do it
once
> per object if it's a simple rigid body.
>
> The trick with making matrices numerically stable is that you don't ever
> want to d

Good to see some activity

2009-08-07 Thread Andrew Park
Hello All,

 

Good to see some activity on here.

 

It would be interesting to know what projects people are working on I have a
Hunchback game in progress and the startings of a sam version of JSW i'd
like to get these finished this year in time for the 20th Birthday but more
chance of getting "LumpBack" finished than JSW,

 

Does anyone know if there will be a bit of a get together ? i live only a
few miles from the original SAM HQ and pass it regularly but it's a bit
short notice now for me to sort anything out.

 

Andy (Taff)

 



Re: Good to see some activity

2009-08-07 Thread david

Quoting Andrew Park :


It would be interesting to know what projects people are working on I have a
Hunchback game in progress and the startings of a sam version of JSW i'd
like to get these finished this year in time for the 20th Birthday but more
chance of getting "LumpBack" finished than JSW,


If you want to bash ideas - not code i'm afraid... php I can manage -  
Z80 is past me... about JSW - I've a few basic ideas from Manic  
Mansion still in the back of my head :)


But please finish whichever is closest to completion first! :)



Does anyone know if there will be a bit of a get together ? i live only a
few miles from the original SAM HQ and pass it regularly but it's a bit
short notice now for me to sort anything out.


Wonder if Bruce is still anywhere down that area?


Re: SAM's 20th Birthday

2009-08-07 Thread david

Quoting LCD :


da...@properbastard.co.uk schrieb:

Quoting Roger Jowett :


velesoft reckon they have a spectrum edge connector adapter but ive been to
prague twice and they sure as hell aint very friendly - pity the dma and
accelerator with 128 kompatiblity might have been useful if they worked -
joystick port on a mouse interface - mind you ps2 rollerball mouse support


Shame the SAMVOX2 never appeared .. :(

8056 co-processort, DMA audio, and a few other odds and sods if I   
remember right :(



Shame about MIDGET too. Nowdays it woud be shipped with a 3D Processor. :(


If only Martin Rookyard and Cookie had more time back then... people  
didn't know the half of what that system could have been capable of ...


RE: SAM's 20th Birthday

2009-08-07 Thread Simon Cooke
Yeah, but you know, looking back... I think it was a bit of a pipedream.
Would have been better to focus on coming up with a new system - or a new
ASIC.

*sigh* I hate getting older. It makes you much more cynical.

-Original Message-
From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
Behalf Of da...@properbastard.co.uk
Sent: Friday, August 07, 2009 1:32 PM
To: sam-users@nvg.ntnu.no; LCD
Subject: Re: SAM's 20th Birthday

Quoting LCD :

> da...@properbastard.co.uk schrieb:
>> Quoting Roger Jowett :
>>
>>> velesoft reckon they have a spectrum edge connector adapter but ive been
to
>>> prague twice and they sure as hell aint very friendly - pity the dma and
>>> accelerator with 128 kompatiblity might have been useful if they worked
-
>>> joystick port on a mouse interface - mind you ps2 rollerball mouse
support
>>
>> Shame the SAMVOX2 never appeared .. :(
>>
>> 8056 co-processort, DMA audio, and a few other odds and sods if I   
>> remember right :(
>>
> Shame about MIDGET too. Nowdays it woud be shipped with a 3D Processor. :(

If only Martin Rookyard and Cookie had more time back then... people  
didn't know the half of what that system could have been capable of ...