Re: Hi - just checking

2009-08-19 Thread Roger Jowett
;>>>> 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 othe

Re: Hi - just checking

2009-08-19 Thread David Sanders
; 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 inte

Re: Hi - just checking

2009-08-19 Thread Roger Jowett
 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 

Re: Hi - just checking

2009-08-19 Thread Roger Jowett
http://www.youtube.com/watch?v=ALLAUaVoQC0&feature=channel_page

dunno if youd need a dma for this in mode1 or it'd b n e easier in mode2
will try mode 3 next then if anyone knows an easy to use interlace routine
would the second interlaced screen be one pixel line below the first -
is that how it works its alternate scan lines

2009/8/19 Roger Jowett :
> but surely the code can be fed into the samc compiler no - sam vision
> erm it looks close?!
> are you sure that as teh filled in cube rotates it wouldnt be easier
> to drop to mode1 couldnt you fill 64 pixels of colour witha single
> byte attribute square only need to work out how many you could get
> away with seems a bit jerk how many frames does it take to draw?
>  have you tried the echologia demo with the dma and mb-02+ in real
> spectrum  - not sure if they are using the dma tah much some models
> take 3 to 7 frames to draw
> wouldnt a sam dma be a wee bit faster than the quoted 17jb per frame
> velesoft reckon the dma datagear interface handles in on128k
> also do you need masterdos to detect an external sam - its only
> another 3mhz but what about those register hungry emulators like the
> apple and oric or whatever its called oreo - isnt that a biscuit?
> did you catcht eh text font its taken me a lng time
> silver paint tonight pressure sensitive keyboard membrane here i come!
> - didnt realise the 128keypad had a pic controller in it dont they go
> up to 80mhz! theres development kits in  maplin £44 or build it your
> self for £25ish grade b=£20
> http://www.maplin.co.uk/Search.aspx?menuno=12483
>
> usb...
>
> http://www.maplin.co.uk/Search.aspx?menuno=12545
>
>
> 2009/8/7 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

Re: Hi - just checking

2009-08-19 Thread Roger Jowett
but surely the code can be fed into the samc compiler no - sam vision
erm it looks close?!
are you sure that as teh filled in cube rotates it wouldnt be easier
to drop to mode1 couldnt you fill 64 pixels of colour witha single
byte attribute square only need to work out how many you could get
away with seems a bit jerk how many frames does it take to draw?
 have you tried the echologia demo with the dma and mb-02+ in real
spectrum  - not sure if they are using the dma tah much some models
take 3 to 7 frames to draw
wouldnt a sam dma be a wee bit faster than the quoted 17jb per frame
velesoft reckon the dma datagear interface handles in on128k
also do you need masterdos to detect an external sam - its only
another 3mhz but what about those register hungry emulators like the
apple and oric or whatever its called oreo - isnt that a biscuit?
did you catcht eh text font its taken me a lng time
silver paint tonight pressure sensitive keyboard membrane here i come!
- didnt realise the 128keypad had a pic controller in it dont they go
up to 80mhz! theres development kits in  maplin £44 or build it your
self for £25ish grade b=£20
http://www.maplin.co.uk/Search.aspx?menuno=12483

usb...

http://www.maplin.co.uk/Search.aspx?menuno=12545


2009/8/7 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

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 

Re: Hi - just checking

2009-08-05 Thread Thomas Harte
06 250 7892 XBOX Live GamerTag: Spec Tec
>
> -----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 5:14 AM
> To: sam-users@nvg.ntnu.no
> Subject: Re: Hi - just checking
>
> That's not entirely true. Matrices are numerically unstable, so the
> cost of ensuring they remain orthonormal when applying consecutive
> local transforms in a game such as Elite is substantially greater than
> the cost of ensuring that a quaternion remains of unit length.
>
> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
>
> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
> way I calculate it, you can fix a quaternion and convert it into a
> matrix in less than you can fix up a matrix. Furthermore, quaternion
> composition is 16 multiplies and 12 adds, whereas matrix composition
> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
> multiplies and 18 adds. And that's with the translation component not
> completely factored in (I'm reading actual code off screen and have
> optimised the translation out of this particular batch).
>
> Elite is also a perfect example of when Euler's aren't fine, even if
> they didn't produce Gimbal lock, as all rotation is around local axes.
> And besides that, Euler angles always have to be converted to some
> other form before they can be applied to arbitrary geometry. Matrices
> require no further transforms.
>
> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
>> You only really need quaternions if you're doing animation or
> interpolation.
>> If you can live with the gimble lock, euler's fine.
>>
>> -Original Message-
>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>> Behalf Of Thomas Harte
>> Sent: Tuesday, August 04, 2009 10:05 AM
>> To: sam-users@nvg.ntnu.no
>> Subject: Re: Hi - just checking
>>
>> Am I replying to the correct thread? I don't know. But I've had the
>> opposite experience to a bunch of people here, having become
>> substantially more busy in my work than I was even just a few months
>> ago, squeezing the SAM temporarily out.
>>
>> A version of my vector 3d-stuff-as-a-library-for-others was all but
>> finished several months ago, I'll endeavour to get that out, though it
>> still has the awkward limitation of doing rotations with Euler angles
>> only - which may be less efficient and is certainly more limiting than
>> special orthogonals or quaternions.
>>
>> I'm still thinking about smart ways to optimise the reverse face
>> stuff. I need to get something hierarchical or otherwise group-related
>> in there; checking every single face is obviously not the optimal way
>> to proceed. I guess what I'm looking for is some sort of bin-type
>> mapping to the surface of the unit sphere that allows all the points
>> on a particular hemisphere to be isolated from the majority of the
>> points on the opposite hemisphere. Or, you know, something at least a
>> lot like a sphere. Though I'm not sure any sort of lookup into
>> something a lot like a sphere would help much as it'd need to be
>> indexed by a three-tuple.
>>
>> I guess a good broad sweep would be to mark each face according to the
>> visibility of the faces of a bounding box - if a face on the real
>> model points away from the face on the bounding box then it definitely
>> can't be visible if the box face is. Or something like that.
>>
>> I'm going to stop thinking aloud now...
>>
>> On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
>> wrote:
>>> I guess when the clocks go back in October SAM users will hibernate over
>> the
>>> winter until next August!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>>> Behalf Of Ian Spencer
>>> Sent: 04 August 2009 08:04
>>>
>>> To: sam-users@nvg.ntnu.no
>>> Subject: Re: Hi - just checking
>>>
>>>
>>>
>>> Wow, I just sent the checking mail to see whether something was wrong
> with
>>> my subscription to the group and it seems it was like poking a stick into
>> a
>>> hornets nest (in a positive sort of way) - over 40 mails in the last few
>>> days on the group. It's just great to see everyone is alive and kicking
>> out
>>> there.
>>>
>>>
>>>
>>> Ian
>>>
>>>
>>>
>>> - Original Message -
>>>
>>> From: Ian Spencer
>>>
>>> To: sam-users@nvg.ntnu.no
>>>
>>> Sent: Friday, July 31, 2009 4:10 PM
>>>
>>> Subject: Hi - just checking
>>>
>>>
>>>
>>> Not heard anything on the group for quite a while so just thought I would
>>> send a 'test' to check it's not me that's got a problem and say hi to
>>> everyone.
>>>
>>> I know you've all taken your Sam's to the beach and so no activity on the
>>> group.
>>>
>>>
>>>
>>>
>>>
>>> Ian
>>>
>>>
>>>
>>>
>>
>>
>
>


RE: Hi - just checking

2009-08-05 Thread Simon Cooke
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 do a stepwise transform on an object - you regenerate the matrix
from scratch each time. (This is one of those things you never really see in
practice; most engines split out the rotational transforms and keep them
separate, using either an axis-angle representation, quaternions, or in some
bad cases, euler angles [this is what Unreal uses btw]. That way, you keep
fidelity - or at the very least, you don't care too much about inaccuracies
as they come in - you can just ignore them if your object is rotated a
little off; it's not a culumlative error).

Assuming no scaling or shear, just rotation and translation, your
translation is the rightmost column of numbers in the matrix. If all of your
objects are pre-scaled in memory to the right size, all you have to do is
apply the rotation and translation in order to each of the points.
Screen-space projection is a little more difficult, but that one you can
precalc all the divides in.

On machines without SIMD or dedicated 3D instructions (such as the SAM),
it's nearly always best to break out the matrix into individual linear
equations, take the common pieces and only calculate them once, and then
operate on them that way. 

--
Simon Cooke
Director of Engineering / Business Developer, X-RAY KID STUDIOS -
www.x-raykid.com 
Founder, Popcorn Films - www.popcornfilms.com  
Cell: 206 250 7892 XBOX Live GamerTag: Spec Tec

-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 5:14 AM
To: sam-users@nvg.ntnu.no
Subject: Re: Hi - just checking

That's not entirely true. Matrices are numerically unstable, so the
cost of ensuring they remain orthonormal when applying consecutive
local transforms in a game such as Elite is substantially greater than
the cost of ensuring that a quaternion remains of unit length.

I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
numerical error in a quaternion. Conversely, I get 36 multiplies, 21
adds, 3 square roots and 3 divides to fix up an orthonormal matrix.

Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
way I calculate it, you can fix a quaternion and convert it into a
matrix in less than you can fix up a matrix. Furthermore, quaternion
composition is 16 multiplies and 12 adds, whereas matrix composition
(with assumptions about the bottom row of a 4x4) is, ummm, at least 36
multiplies and 18 adds. And that's with the translation component not
completely factored in (I'm reading actual code off screen and have
optimised the translation out of this particular batch).

Elite is also a perfect example of when Euler's aren't fine, even if
they didn't produce Gimbal lock, as all rotation is around local axes.
And besides that, Euler angles always have to be converted to some
other form before they can be applied to arbitrary geometry. Matrices
require no further transforms.

On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
> You only really need quaternions if you're doing animation or
interpolation.
> If you can live with the gimble lock, euler's fine.
>
> -Original Message-
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
> Behalf Of Thomas Harte
> Sent: Tuesday, August 04, 2009 10:05 AM
> To: sam-users@nvg.ntnu.no
> Subject: Re: Hi - just checking
>
> Am I replying to the correct thread? I don't know. But I've had the
> opposite experience to a bunch of people here, having become
> substantially more busy in my work than I was even just a few months
> ago, squeezing the SAM temporarily out.
>
> A version of my vector 3d-stuff-as-a-library-for-others was all but
> finished several months ago, I'll endeavour to get that out, though it
> still has the awkward limitation of doing rotations with Euler angles
> only - which may be less efficient and is certainly more limiting than
> special orthogonals or quaternions.
>
> I'm still thinking about smart ways to optimise the reverse face
> stuff. I need to get something hierarchical or otherwise group-related
> in there; checking every single face is obviously not the optimal way
> to proceed. I guess what I'm looking for is some sort of bin-type
> mapping to the surface of the unit sphere that allows all the points
> on a particular hemisphere to be isolated from the majority of the
> points on the opposite hemisphere. Or, you know, something at least a
> lot like a sphere. Though I'm not sure any sort of lookup into
> something a lot like a sphere would

Re: Hi - just checking

2009-08-05 Thread Roger Jowett
I thought it was BASIC!

2009/8/5 Thomas Harte 

> Oh, sorry, I think I missed the point of your question. My guess would
> be that it uses matrices internally, as they're a popular mathematical
> construct in a variety of fields but quaternions having been seriously
> out of fashion for at least a century. I have a degree in Maths &
> Computer Science but don't recall meeting them even once during my
> studies — though a joint honours degree does necessarily end up
> reducing your exposure to either subject individually.
>
> Also, my guess is that the sort of literature related to computer
> graphics that is now extremely easy to access thanks to the web would
> have been really quite hard to access during the 1980s. It's like a
> hindsight thing. We're perched here at least two decades after
> computer graphics started to break out of academia and into widescale
> usage in consumer products, so we benefit from historical perspective
> and the entire body of knowledge is now much more accessible.
>
> On Wed, Aug 5, 2009 at 1:23 PM, Thomas Harte
> wrote:
> > You mean the Psion one? No idea, as I've never used it or explicitly
> > disassembled anything z80 related. I've entered the z80 assembly fold
> > from the direction of writing emulators. I'd guess that if it's not
> > intended to be particularly realtime then quite possibly they're using
> > the floating point formats supported natively by the Spectrum ROM?
> > It'd save a lot of code and solve a lot of issues, and while being far
> > too slow for realtime it'd probably be fast enough for a
> > rendering-type application.
> >
> > Just guessing, of course.
> >
> > On Wed, Aug 5, 2009 at 1:18 PM, Roger Jowett
> wrote:
> >> what does vu3d use?
> >>
> >> On 05/08/2009, Thomas Harte  wrote:
> >>>
> >>> That's not entirely true. Matrices are numerically unstable, so the
> >>> cost of ensuring they remain orthonormal when applying consecutive
> >>> local transforms in a game such as Elite is substantially greater than
> >>> the cost of ensuring that a quaternion remains of unit length.
> >>>
> >>> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
> >>> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
> >>> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
> >>>
> >>> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
> >>> way I calculate it, you can fix a quaternion and convert it into a
> >>> matrix in less than you can fix up a matrix. Furthermore, quaternion
> >>> composition is 16 multiplies and 12 adds, whereas matrix composition
> >>> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
> >>> multiplies and 18 adds. And that's with the translation component not
> >>> completely factored in (I'm reading actual code off screen and have
> >>> optimised the translation out of this particular batch).
> >>>
> >>> Elite is also a perfect example of when Euler's aren't fine, even if
> >>> they didn't produce Gimbal lock, as all rotation is around local axes.
> >>> And besides that, Euler angles always have to be converted to some
> >>> other form before they can be applied to arbitrary geometry. Matrices
> >>> require no further transforms.
> >>>
> >>> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke
> wrote:
> >>> > You only really need quaternions if you're doing animation or
> >>> > interpolation.
> >>> > If you can live with the gimble lock, euler's fine.
> >>> >
> >>> > -Original Message-
> >>> > From: owner-sam-us...@nvg.ntnu.no [mailto:
> owner-sam-us...@nvg.ntnu.no]
> >>> > On
> >>> > Behalf Of Thomas Harte
> >>> > Sent: Tuesday, August 04, 2009 10:05 AM
> >>> > To: sam-users@nvg.ntnu.no
> >>> > Subject: Re: Hi - just checking
> >>> >
> >>> > Am I replying to the correct thread? I don't know. But I've had the
> >>> > opposite experience to a bunch of people here, having become
> >>> > substantially more busy in my work than I was even just a few months
> >>> > ago, squeezing the SAM temporarily out.
> >>> >
> >>> > A version of my vector 3d-stuff-as-a-library-for-others was all but
> >>> > finished s

Re: Hi - just checking

2009-08-05 Thread Thomas Harte
Oh, sorry, I think I missed the point of your question. My guess would
be that it uses matrices internally, as they're a popular mathematical
construct in a variety of fields but quaternions having been seriously
out of fashion for at least a century. I have a degree in Maths &
Computer Science but don't recall meeting them even once during my
studies — though a joint honours degree does necessarily end up
reducing your exposure to either subject individually.

Also, my guess is that the sort of literature related to computer
graphics that is now extremely easy to access thanks to the web would
have been really quite hard to access during the 1980s. It's like a
hindsight thing. We're perched here at least two decades after
computer graphics started to break out of academia and into widescale
usage in consumer products, so we benefit from historical perspective
and the entire body of knowledge is now much more accessible.

On Wed, Aug 5, 2009 at 1:23 PM, Thomas Harte wrote:
> You mean the Psion one? No idea, as I've never used it or explicitly
> disassembled anything z80 related. I've entered the z80 assembly fold
> from the direction of writing emulators. I'd guess that if it's not
> intended to be particularly realtime then quite possibly they're using
> the floating point formats supported natively by the Spectrum ROM?
> It'd save a lot of code and solve a lot of issues, and while being far
> too slow for realtime it'd probably be fast enough for a
> rendering-type application.
>
> Just guessing, of course.
>
> On Wed, Aug 5, 2009 at 1:18 PM, Roger Jowett wrote:
>> what does vu3d use?
>>
>> On 05/08/2009, Thomas Harte  wrote:
>>>
>>> That's not entirely true. Matrices are numerically unstable, so the
>>> cost of ensuring they remain orthonormal when applying consecutive
>>> local transforms in a game such as Elite is substantially greater than
>>> the cost of ensuring that a quaternion remains of unit length.
>>>
>>> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
>>> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
>>> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
>>>
>>> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
>>> way I calculate it, you can fix a quaternion and convert it into a
>>> matrix in less than you can fix up a matrix. Furthermore, quaternion
>>> composition is 16 multiplies and 12 adds, whereas matrix composition
>>> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
>>> multiplies and 18 adds. And that's with the translation component not
>>> completely factored in (I'm reading actual code off screen and have
>>> optimised the translation out of this particular batch).
>>>
>>> Elite is also a perfect example of when Euler's aren't fine, even if
>>> they didn't produce Gimbal lock, as all rotation is around local axes.
>>> And besides that, Euler angles always have to be converted to some
>>> other form before they can be applied to arbitrary geometry. Matrices
>>> require no further transforms.
>>>
>>> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
>>> > You only really need quaternions if you're doing animation or
>>> > interpolation.
>>> > If you can live with the gimble lock, euler's fine.
>>> >
>>> > -Original Message-
>>> > From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no]
>>> > On
>>> > Behalf Of Thomas Harte
>>> > Sent: Tuesday, August 04, 2009 10:05 AM
>>> > To: sam-users@nvg.ntnu.no
>>> > Subject: Re: Hi - just checking
>>> >
>>> > Am I replying to the correct thread? I don't know. But I've had the
>>> > opposite experience to a bunch of people here, having become
>>> > substantially more busy in my work than I was even just a few months
>>> > ago, squeezing the SAM temporarily out.
>>> >
>>> > A version of my vector 3d-stuff-as-a-library-for-others was all but
>>> > finished several months ago, I'll endeavour to get that out, though it
>>> > still has the awkward limitation of doing rotations with Euler angles
>>> > only - which may be less efficient and is certainly more limiting than
>>> > special orthogonals or quaternions.
>>> >
>>> > I'm still thinking about smart ways to optimise the reverse face
>>> > stuff. I need to get something hierarc

Re: Hi - just checking

2009-08-05 Thread Thomas Harte
You mean the Psion one? No idea, as I've never used it or explicitly
disassembled anything z80 related. I've entered the z80 assembly fold
from the direction of writing emulators. I'd guess that if it's not
intended to be particularly realtime then quite possibly they're using
the floating point formats supported natively by the Spectrum ROM?
It'd save a lot of code and solve a lot of issues, and while being far
too slow for realtime it'd probably be fast enough for a
rendering-type application.

Just guessing, of course.

On Wed, Aug 5, 2009 at 1:18 PM, Roger Jowett wrote:
> what does vu3d use?
>
> On 05/08/2009, Thomas Harte  wrote:
>>
>> That's not entirely true. Matrices are numerically unstable, so the
>> cost of ensuring they remain orthonormal when applying consecutive
>> local transforms in a game such as Elite is substantially greater than
>> the cost of ensuring that a quaternion remains of unit length.
>>
>> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
>> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
>> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
>>
>> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
>> way I calculate it, you can fix a quaternion and convert it into a
>> matrix in less than you can fix up a matrix. Furthermore, quaternion
>> composition is 16 multiplies and 12 adds, whereas matrix composition
>> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
>> multiplies and 18 adds. And that's with the translation component not
>> completely factored in (I'm reading actual code off screen and have
>> optimised the translation out of this particular batch).
>>
>> Elite is also a perfect example of when Euler's aren't fine, even if
>> they didn't produce Gimbal lock, as all rotation is around local axes.
>> And besides that, Euler angles always have to be converted to some
>> other form before they can be applied to arbitrary geometry. Matrices
>> require no further transforms.
>>
>> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
>> > You only really need quaternions if you're doing animation or
>> > interpolation.
>> > If you can live with the gimble lock, euler's fine.
>> >
>> > -Original Message-
>> > From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no]
>> > On
>> > Behalf Of Thomas Harte
>> > Sent: Tuesday, August 04, 2009 10:05 AM
>> > To: sam-users@nvg.ntnu.no
>> > Subject: Re: Hi - just checking
>> >
>> > Am I replying to the correct thread? I don't know. But I've had the
>> > opposite experience to a bunch of people here, having become
>> > substantially more busy in my work than I was even just a few months
>> > ago, squeezing the SAM temporarily out.
>> >
>> > A version of my vector 3d-stuff-as-a-library-for-others was all but
>> > finished several months ago, I'll endeavour to get that out, though it
>> > still has the awkward limitation of doing rotations with Euler angles
>> > only - which may be less efficient and is certainly more limiting than
>> > special orthogonals or quaternions.
>> >
>> > I'm still thinking about smart ways to optimise the reverse face
>> > stuff. I need to get something hierarchical or otherwise group-related
>> > in there; checking every single face is obviously not the optimal way
>> > to proceed. I guess what I'm looking for is some sort of bin-type
>> > mapping to the surface of the unit sphere that allows all the points
>> > on a particular hemisphere to be isolated from the majority of the
>> > points on the opposite hemisphere. Or, you know, something at least a
>> > lot like a sphere. Though I'm not sure any sort of lookup into
>> > something a lot like a sphere would help much as it'd need to be
>> > indexed by a three-tuple.
>> >
>> > I guess a good broad sweep would be to mark each face according to the
>> > visibility of the faces of a bounding box - if a face on the real
>> > model points away from the face on the bounding box then it definitely
>> > can't be visible if the box face is. Or something like that.
>> >
>> > I'm going to stop thinking aloud now...
>> >
>> > On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
>> > wrote:
>> >> I guess when the clocks go back in October SAM users will hibernate
>> >&

Re: Hi - just checking

2009-08-05 Thread Thomas Harte
Oh, I'm currently using 2.14 fixed point for matrix components (engine
goes Eulers -> matrix, apply that) if that helps the discussion of the
level of nuisance caused by numerical errors.

Earlier versions of the code, including I think the version last
provided on Sam Revival, used 8.8 fixed point throughout but that
produced some visible precision issues. 2.14 isn't exactly perfect,
but it's as good as things are going to get without a major speed
tradeoff. The 2.14 is used only for matrix generation and composition
(since objects are assumed to be positioned under the influence of
exactly two matrices in my code — a camera matrix and an object
matrix), it's rendered down to 8.8 for geometry transformation.

On Wed, Aug 5, 2009 at 1:14 PM, Thomas Harte wrote:
> That's not entirely true. Matrices are numerically unstable, so the
> cost of ensuring they remain orthonormal when applying consecutive
> local transforms in a game such as Elite is substantially greater than
> the cost of ensuring that a quaternion remains of unit length.
>
> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
>
> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
> way I calculate it, you can fix a quaternion and convert it into a
> matrix in less than you can fix up a matrix. Furthermore, quaternion
> composition is 16 multiplies and 12 adds, whereas matrix composition
> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
> multiplies and 18 adds. And that's with the translation component not
> completely factored in (I'm reading actual code off screen and have
> optimised the translation out of this particular batch).
>
> Elite is also a perfect example of when Euler's aren't fine, even if
> they didn't produce Gimbal lock, as all rotation is around local axes.
> And besides that, Euler angles always have to be converted to some
> other form before they can be applied to arbitrary geometry. Matrices
> require no further transforms.
>
> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
>> You only really need quaternions if you're doing animation or interpolation.
>> If you can live with the gimble lock, euler's fine.
>>
>> -Original Message-
>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>> Behalf Of Thomas Harte
>> Sent: Tuesday, August 04, 2009 10:05 AM
>> To: sam-users@nvg.ntnu.no
>> Subject: Re: Hi - just checking
>>
>> Am I replying to the correct thread? I don't know. But I've had the
>> opposite experience to a bunch of people here, having become
>> substantially more busy in my work than I was even just a few months
>> ago, squeezing the SAM temporarily out.
>>
>> A version of my vector 3d-stuff-as-a-library-for-others was all but
>> finished several months ago, I'll endeavour to get that out, though it
>> still has the awkward limitation of doing rotations with Euler angles
>> only - which may be less efficient and is certainly more limiting than
>> special orthogonals or quaternions.
>>
>> I'm still thinking about smart ways to optimise the reverse face
>> stuff. I need to get something hierarchical or otherwise group-related
>> in there; checking every single face is obviously not the optimal way
>> to proceed. I guess what I'm looking for is some sort of bin-type
>> mapping to the surface of the unit sphere that allows all the points
>> on a particular hemisphere to be isolated from the majority of the
>> points on the opposite hemisphere. Or, you know, something at least a
>> lot like a sphere. Though I'm not sure any sort of lookup into
>> something a lot like a sphere would help much as it'd need to be
>> indexed by a three-tuple.
>>
>> I guess a good broad sweep would be to mark each face according to the
>> visibility of the faces of a bounding box - if a face on the real
>> model points away from the face on the bounding box then it definitely
>> can't be visible if the box face is. Or something like that.
>>
>> I'm going to stop thinking aloud now...
>>
>> On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
>> wrote:
>>> I guess when the clocks go back in October SAM users will hibernate over
>> the
>>> winter until next August!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>>> Behalf Of Ian Sp

Re: Hi - just checking

2009-08-05 Thread Roger Jowett
what does vu3d use?

On 05/08/2009, Thomas Harte  wrote:
>
> That's not entirely true. Matrices are numerically unstable, so the
> cost of ensuring they remain orthonormal when applying consecutive
> local transforms in a game such as Elite is substantially greater than
> the cost of ensuring that a quaternion remains of unit length.
>
> I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
> numerical error in a quaternion. Conversely, I get 36 multiplies, 21
> adds, 3 square roots and 3 divides to fix up an orthonormal matrix.
>
> Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
> way I calculate it, you can fix a quaternion and convert it into a
> matrix in less than you can fix up a matrix. Furthermore, quaternion
> composition is 16 multiplies and 12 adds, whereas matrix composition
> (with assumptions about the bottom row of a 4x4) is, ummm, at least 36
> multiplies and 18 adds. And that's with the translation component not
> completely factored in (I'm reading actual code off screen and have
> optimised the translation out of this particular batch).
>
> Elite is also a perfect example of when Euler's aren't fine, even if
> they didn't produce Gimbal lock, as all rotation is around local axes.
> And besides that, Euler angles always have to be converted to some
> other form before they can be applied to arbitrary geometry. Matrices
> require no further transforms.
>
> On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
> > You only really need quaternions if you're doing animation or
> interpolation.
> > If you can live with the gimble lock, euler's fine.
> >
> > -Original Message-
> > From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no]
> On
> > Behalf Of Thomas Harte
> > Sent: Tuesday, August 04, 2009 10:05 AM
> > To: sam-users@nvg.ntnu.no
> > Subject: Re: Hi - just checking
> >
> > Am I replying to the correct thread? I don't know. But I've had the
> > opposite experience to a bunch of people here, having become
> > substantially more busy in my work than I was even just a few months
> > ago, squeezing the SAM temporarily out.
> >
> > A version of my vector 3d-stuff-as-a-library-for-others was all but
> > finished several months ago, I'll endeavour to get that out, though it
> > still has the awkward limitation of doing rotations with Euler angles
> > only - which may be less efficient and is certainly more limiting than
> > special orthogonals or quaternions.
> >
> > I'm still thinking about smart ways to optimise the reverse face
> > stuff. I need to get something hierarchical or otherwise group-related
> > in there; checking every single face is obviously not the optimal way
> > to proceed. I guess what I'm looking for is some sort of bin-type
> > mapping to the surface of the unit sphere that allows all the points
> > on a particular hemisphere to be isolated from the majority of the
> > points on the opposite hemisphere. Or, you know, something at least a
> > lot like a sphere. Though I'm not sure any sort of lookup into
> > something a lot like a sphere would help much as it'd need to be
> > indexed by a three-tuple.
> >
> > I guess a good broad sweep would be to mark each face according to the
> > visibility of the faces of a bounding box - if a face on the real
> > model points away from the face on the bounding box then it definitely
> > can't be visible if the box face is. Or something like that.
> >
> > I'm going to stop thinking aloud now...
> >
> > On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
> > wrote:
> >> I guess when the clocks go back in October SAM users will hibernate over
> > the
> >> winter until next August!
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no]
> On
> >> Behalf Of Ian Spencer
> >> Sent: 04 August 2009 08:04
> >>
> >> To: sam-users@nvg.ntnu.no
> >> Subject: Re: Hi - just checking
> >>
> >>
> >>
> >> Wow, I just sent the checking mail to see whether something was wrong
> with
> >> my subscription to the group and it seems it was like poking a stick
> into
> > a
> >> hornets nest (in a positive sort of way) - over 40 mails in the last few
> >> days on the group. It's just great to see everyone is alive and kicking
> > out
> >> there.
> >>
> >>
> >>
> >> Ian
> >>
> >>
> >>
> >> - Original Message -
> >>
> >> From: Ian Spencer
> >>
> >> To: sam-users@nvg.ntnu.no
> >>
> >> Sent: Friday, July 31, 2009 4:10 PM
> >>
> >> Subject: Hi - just checking
> >>
> >>
> >>
> >> Not heard anything on the group for quite a while so just thought I
> would
> >> send a 'test' to check it's not me that's got a problem and say hi to
> >> everyone.
> >>
> >> I know you've all taken your Sam's to the beach and so no activity on
> the
> >> group.
> >>
> >>
> >>
> >>
> >>
> >> Ian
> >>
> >>
> >>
> >>
> >
> >
>


Re: Hi - just checking

2009-08-05 Thread Thomas Harte
That's not entirely true. Matrices are numerically unstable, so the
cost of ensuring they remain orthonormal when applying consecutive
local transforms in a game such as Elite is substantially greater than
the cost of ensuring that a quaternion remains of unit length.

I make it 8 multiplies, 3 adds, 1 square root and 1 divide to fix up
numerical error in a quaternion. Conversely, I get 36 multiplies, 21
adds, 3 square roots and 3 divides to fix up an orthonormal matrix.

Quaternion to matrix is 10 multiplies, 6 shifts and 14 adds. So the
way I calculate it, you can fix a quaternion and convert it into a
matrix in less than you can fix up a matrix. Furthermore, quaternion
composition is 16 multiplies and 12 adds, whereas matrix composition
(with assumptions about the bottom row of a 4x4) is, ummm, at least 36
multiplies and 18 adds. And that's with the translation component not
completely factored in (I'm reading actual code off screen and have
optimised the translation out of this particular batch).

Elite is also a perfect example of when Euler's aren't fine, even if
they didn't produce Gimbal lock, as all rotation is around local axes.
And besides that, Euler angles always have to be converted to some
other form before they can be applied to arbitrary geometry. Matrices
require no further transforms.

On Wed, Aug 5, 2009 at 2:12 AM, Simon Cooke wrote:
> You only really need quaternions if you're doing animation or interpolation.
> If you can live with the gimble lock, euler's fine.
>
> -Original Message-
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
> Behalf Of Thomas Harte
> Sent: Tuesday, August 04, 2009 10:05 AM
> To: sam-users@nvg.ntnu.no
> Subject: Re: Hi - just checking
>
> Am I replying to the correct thread? I don't know. But I've had the
> opposite experience to a bunch of people here, having become
> substantially more busy in my work than I was even just a few months
> ago, squeezing the SAM temporarily out.
>
> A version of my vector 3d-stuff-as-a-library-for-others was all but
> finished several months ago, I'll endeavour to get that out, though it
> still has the awkward limitation of doing rotations with Euler angles
> only - which may be less efficient and is certainly more limiting than
> special orthogonals or quaternions.
>
> I'm still thinking about smart ways to optimise the reverse face
> stuff. I need to get something hierarchical or otherwise group-related
> in there; checking every single face is obviously not the optimal way
> to proceed. I guess what I'm looking for is some sort of bin-type
> mapping to the surface of the unit sphere that allows all the points
> on a particular hemisphere to be isolated from the majority of the
> points on the opposite hemisphere. Or, you know, something at least a
> lot like a sphere. Though I'm not sure any sort of lookup into
> something a lot like a sphere would help much as it'd need to be
> indexed by a three-tuple.
>
> I guess a good broad sweep would be to mark each face according to the
> visibility of the faces of a bounding box - if a face on the real
> model points away from the face on the bounding box then it definitely
> can't be visible if the box face is. Or something like that.
>
> I'm going to stop thinking aloud now...
>
> On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
> wrote:
>> I guess when the clocks go back in October SAM users will hibernate over
> the
>> winter until next August!
>>
>>
>>
>>
>>
>>
>>
>> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
>> Behalf Of Ian Spencer
>> Sent: 04 August 2009 08:04
>>
>> To: sam-users@nvg.ntnu.no
>> Subject: Re: Hi - just checking
>>
>>
>>
>> Wow, I just sent the checking mail to see whether something was wrong with
>> my subscription to the group and it seems it was like poking a stick into
> a
>> hornets nest (in a positive sort of way) - over 40 mails in the last few
>> days on the group. It's just great to see everyone is alive and kicking
> out
>> there.
>>
>>
>>
>> Ian
>>
>>
>>
>> - Original Message -
>>
>> From: Ian Spencer
>>
>> To: sam-users@nvg.ntnu.no
>>
>> Sent: Friday, July 31, 2009 4:10 PM
>>
>> Subject: Hi - just checking
>>
>>
>>
>> Not heard anything on the group for quite a while so just thought I would
>> send a 'test' to check it's not me that's got a problem and say hi to
>> everyone.
>>
>> I know you've all taken your Sam's to the beach and so no activity on the
>> group.
>>
>>
>>
>>
>>
>> Ian
>>
>>
>>
>>
>
>


RE: Hi - just checking

2009-08-04 Thread Simon Cooke
You only really need quaternions if you're doing animation or interpolation.
If you can live with the gimble lock, euler's fine. 

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

Am I replying to the correct thread? I don't know. But I've had the
opposite experience to a bunch of people here, having become
substantially more busy in my work than I was even just a few months
ago, squeezing the SAM temporarily out.

A version of my vector 3d-stuff-as-a-library-for-others was all but
finished several months ago, I'll endeavour to get that out, though it
still has the awkward limitation of doing rotations with Euler angles
only - which may be less efficient and is certainly more limiting than
special orthogonals or quaternions.

I'm still thinking about smart ways to optimise the reverse face
stuff. I need to get something hierarchical or otherwise group-related
in there; checking every single face is obviously not the optimal way
to proceed. I guess what I'm looking for is some sort of bin-type
mapping to the surface of the unit sphere that allows all the points
on a particular hemisphere to be isolated from the majority of the
points on the opposite hemisphere. Or, you know, something at least a
lot like a sphere. Though I'm not sure any sort of lookup into
something a lot like a sphere would help much as it'd need to be
indexed by a three-tuple.

I guess a good broad sweep would be to mark each face according to the
visibility of the faces of a bounding box - if a face on the real
model points away from the face on the bounding box then it definitely
can't be visible if the box face is. Or something like that.

I'm going to stop thinking aloud now...

On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas
wrote:
> I guess when the clocks go back in October SAM users will hibernate over
the
> winter until next August!
>
>
>
>
>
>
>
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
> Behalf Of Ian Spencer
> Sent: 04 August 2009 08:04
>
> To: sam-users@nvg.ntnu.no
> Subject: Re: Hi - just checking
>
>
>
> Wow, I just sent the checking mail to see whether something was wrong with
> my subscription to the group and it seems it was like poking a stick into
a
> hornets nest (in a positive sort of way) - over 40 mails in the last few
> days on the group. It's just great to see everyone is alive and kicking
out
> there.
>
>
>
> Ian
>
>
>
> - Original Message -
>
> From: Ian Spencer
>
> To: sam-users@nvg.ntnu.no
>
> Sent: Friday, July 31, 2009 4:10 PM
>
> Subject: Hi - just checking
>
>
>
> Not heard anything on the group for quite a while so just thought I would
> send a 'test' to check it's not me that's got a problem and say hi to
> everyone.
>
> I know you've all taken your Sam's to the beach and so no activity on the
> group.
>
>
>
>
>
> Ian
>
>
>
>



Re: Hi - just checking

2009-08-04 Thread Thomas Harte
Am I replying to the correct thread? I don't know. But I've had the
opposite experience to a bunch of people here, having become
substantially more busy in my work than I was even just a few months
ago, squeezing the SAM temporarily out.

A version of my vector 3d-stuff-as-a-library-for-others was all but
finished several months ago, I'll endeavour to get that out, though it
still has the awkward limitation of doing rotations with Euler angles
only — which may be less efficient and is certainly more limiting than
special orthogonals or quaternions.

I'm still thinking about smart ways to optimise the reverse face
stuff. I need to get something hierarchical or otherwise group-related
in there; checking every single face is obviously not the optimal way
to proceed. I guess what I'm looking for is some sort of bin-type
mapping to the surface of the unit sphere that allows all the points
on a particular hemisphere to be isolated from the majority of the
points on the opposite hemisphere. Or, you know, something at least a
lot like a sphere. Though I'm not sure any sort of lookup into
something a lot like a sphere would help much as it'd need to be
indexed by a three-tuple.

I guess a good broad sweep would be to mark each face according to the
visibility of the faces of a bounding box — if a face on the real
model points away from the face on the bounding box then it definitely
can't be visible if the box face is. Or something like that.

I'm going to stop thinking aloud now...

On Tue, Aug 4, 2009 at 10:22 AM, Steve Parry-Thomas wrote:
> I guess when the clocks go back in October SAM users will hibernate over the
> winter until next August!
>
>
>
>
>
>
>
> From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
> Behalf Of Ian Spencer
> Sent: 04 August 2009 08:04
>
> To: sam-users@nvg.ntnu.no
> Subject: Re: Hi - just checking
>
>
>
> Wow, I just sent the checking mail to see whether something was wrong with
> my subscription to the group and it seems it was like poking a stick into a
> hornets nest (in a positive sort of way) - over 40 mails in the last few
> days on the group. It's just great to see everyone is alive and kicking out
> there.
>
>
>
> Ian
>
>
>
> - Original Message -
>
> From: Ian Spencer
>
> To: sam-users@nvg.ntnu.no
>
> Sent: Friday, July 31, 2009 4:10 PM
>
> Subject: Hi - just checking
>
>
>
> Not heard anything on the group for quite a while so just thought I would
> send a 'test' to check it's not me that's got a problem and say hi to
> everyone.
>
> I know you've all taken your Sam's to the beach and so no activity on the
> group.
>
>
>
>
>
> Ian
>
>
>
>


RE: Hi - just checking

2009-08-04 Thread Steve Parry-Thomas
I guess when the clocks go back in October SAM users will hibernate over the
winter until next August! 
 
 
 
From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
Behalf Of Ian Spencer
Sent: 04 August 2009 08:04
To: sam-users@nvg.ntnu.no
Subject: Re: Hi - just checking
 
Wow, I just sent the checking mail to see whether something was wrong with
my subscription to the group and it seems it was like poking a stick into a
hornets nest (in a positive sort of way) - over 40 mails in the last few
days on the group. It's just great to see everyone is alive and kicking out
there.
 
Ian
 
- Original Message - 
From: Ian Spencer <mailto:ian.spen...@freenet.de>  
To: sam-users@nvg.ntnu.no 
Sent: Friday, July 31, 2009 4:10 PM
Subject: Hi - just checking
 
Not heard anything on the group for quite a while so just thought I would
send a 'test' to check it's not me that's got a problem and say hi to
everyone.
I know you've all taken your Sam's to the beach and so no activity on the
group.
 
 
Ian
 
 


Re: Hi - just checking

2009-08-04 Thread Ian Spencer
Wow, I just sent the checking mail to see whether something was wrong with my 
subscription to the group and it seems it was like poking a stick into a 
hornets nest (in a positive sort of way) - over 40 mails in the last few days 
on the group. It's just great to see everyone is alive and kicking out there.

Ian

  - Original Message - 
  From: Ian Spencer 
  To: sam-users@nvg.ntnu.no 
  Sent: Friday, July 31, 2009 4:10 PM
  Subject: Hi - just checking


  Not heard anything on the group for quite a while so just thought I would 
send a 'test' to check it's not me that's got a problem and say hi to everyone.
  I know you've all taken your Sam's to the beach and so no activity on the 
group.


  Ian



Re: Hi - just checking

2009-08-03 Thread Andrew Collier

On 31 Jul 2009, at 18:46, LCD wrote:


maybe everyone is busy with their next SAM Mega hit game? ;-).



Actually, it's funny you should mention that

Andrew

--
http://www.intensity.org.uk/



Re: Hi - just checking

2009-08-03 Thread nev young

Ian Spencer wrote:
Not heard anything on the group for quite a while so just thought I 
would send a 'test' to check it's not me that's got a problem and say hi 
to everyone.


While looking for "something else" I came across this page and as a 
result have wasted most of the morning reading old sam-users posts.


http://www.atbirmingham.com/warwick/cooke_cl

Still it's good to know that Sam moves in academic circles. ;-)

Nev


Re: Hi - just checking

2009-08-02 Thread Colin Piggot

Ian wrote:
Not heard anything on the group for quite a while so just thought I would 
send a 'test' to check it's not me that's got a problem and say hi to 
everyone.
I know you've all taken your Sam's to the beach and so no activity on the 
group.


I've been a bit quiet, but still been getting on with a few things.

First up is an update for B-DOS 1.5t for the Trinity Ethernet Interface 
which I've put in a few extra additions into the code for utilising the 
microcontroller on the interface more to give a 15% speedup in loading. I've 
also finished an Autoboot ROM for the Trinity so B-DOS can be loaded from 
the Trinity's EEPROM on startup, or really it loads a 1K bootblock from the 
EEPROM so you can really have it do whatever you want it to do on startup, 
but loading B-DOS seems the most obvious choice! (Video on YouTube - 
http://www.youtube.com/watch?v=eGoXsY4PBck )


I've set up twitter so I'm now getting into the swing of just popping up 
short updates as and when I'm working on things - 
http://www.twitter.com/QuazarSamCoupe.


SAM Revival 23 will be out this month (about time! Ed), a bit late, but time 
hasn't been on my side recently. Also I'm moving to a different DTP 
package - getting away from a very (very!) early version of Quarkxpress that 
I've been using for donkies years! On the coverdisk will be Simon's VIC-20 
emulator, the latest 3D Demo from Thomas Harte to go with his article in the 
magazine and a game or two depending on what space is left. Articles wise, a 
fair few bits of news, tech stuff and source for the Trinity Autoboot, the 
B-DOS loading bootblock and the short changes to the B-DOS source code to 
give the 15% speed up.


Going back to the earlier thread of SAM's birthday, I think it's fairly safe 
to say now with the work going on behind the scenes that the idea I had of a 
special glossy A4 sized edition will be going ahead thanks to the printing 
costs Adrian was able to get (Thanks Adrian!). It'll all be new material, 
with quite a few articles and some exclusives already underway in the 
drafting stages and I'll no doubt be in touch with a lot of people in the 
coming months to get some bits of info and their memories of their time with 
the SAM. I'll be aiming for it to go to print for release in December.


Colin
=
Quazar : Hardware, Software, Spares and Repairs for the SAM Coupe
1995-2009 - Celebrating 15 Years of developing for the SAM Coupe
Website: http://www.samcoupe.com/ 



Re: Hi - just checking

2009-08-01 Thread nev young


Hi Roger,

Could I ask that you don't sent your posts direct to me *and* the list.
I'm on the list so I'm seeing it all twice.

It all appears to be about cp/m, of which I know nothing, so I have to 
ignore it twice ;-)


Thankx

Nev



Re: Hi - just checking

2009-08-01 Thread Roger Jowett
just tried to use the 80 column text editor for cpm fo rthe sam its
absolute rubbish!
the cursor keys on the pc keyboard dont even work and the screen
refresh takes ½ an hour to keep up!
dont we know anyone who managed to pull off a 128k conversion for teh sam
they wouldnt need to bother with anything too complex tasword was only
64kb for the 128 machines its just the paging that needs altered?
what do i need to do disassemble it and then go thru looking for all
the outs that correspond to the speccy 128 ram out port? how do i do
that surely the edit find thing on the pc can do most of that?
i only liked using it because you could use the original speccy 32
column mode which was legible as the 64 dolum used only 4 pixels!
utterly illegibly - shouldnt be too bad on the timex or the sams 512
mode though depends how close your nose is to the screen!


http://www.youtube.com/watch?v=oX3blkwNjLU&feature=related

sam juggler theres a few others on there too these are not quite so
related unless we ever manage to bung an r800 up the edge connector!

http://www.youtube.com/watch?v=1DfDEU_Ifrw

http://www.youtube.com/watch?v=YGH5JIPWQ2I

http://www.youtube.com/watch?v=1DfDEU_Ifrw


2009/8/1 nev young :
> Roger,
> was this meant to come to me rather than the mailing list?
>
> But to answer your question; I rather doubt it as he has "moved on" from the
> 8 bit world and now works for a medium sized ISP type of company.
>
> Regards
>
> Nev
>
> Roger Jowett wrote:
>>
>> would he be interested in using tascon +d to convert tasword +2 for
>> the sam at all?!
>>
>> 2009/7/31 nev young :
>>>
>>> Ian Spencer wrote:

 Not heard anything on the group for quite a while so just thought I
 would
 send a 'test' to check it's not me that's got a problem and say hi to
 everyone.
 I know you've all taken your Sam's to the beach and so no activity on
 the
 group.

>>> Dunno about the beach.
>>> I was searching for something in the loft this week and found four
>>> complete
>>> Sams and about 3 in bits. It made me feel a little sad.
>>>
>>> I'll be going to Gloucester in August and will be seeing B*b. Br*nchl*y
>>> as
>>> his daughter is getting wed.
>>>
>>> Nev
>>>
>>>
>>
>
>


Re: Hi - just checking

2009-07-31 Thread nev young

Ian Spencer wrote:
Not heard anything on the group for quite a while so just thought I 
would send a 'test' to check it's not me that's got a problem and say hi 
to everyone.
I know you've all taken your Sam's to the beach and so no activity on 
the group.
 

Dunno about the beach.
I was searching for something in the loft this week and found four 
complete Sams and about 3 in bits. It made me feel a little sad.


I'll be going to Gloucester in August and will be seeing B*b. Br*nchl*y 
as his daughter is getting wed.


Nev



Re: Hi - just checking

2009-07-31 Thread LCD

Ian Spencer schrieb:
Not heard anything on the group for quite a while so just thought I 
would send a 'test' to check it's not me that's got a problem and say 
hi to everyone.
I know you've all taken your Sam's to the beach and so no activity on 
the group.
 
 
Ian
 
 

True, maybe everyone is busy with their next SAM Mega hit game? ;-).

LCD


RE: Hi - just checking

2009-07-31 Thread Steve Parry-Thomas
Yep it's been very quite.
 
I'm still after any some Pro-Dos CP/M games if anyone can help?

Steve(spt)
 
From: owner-sam-us...@nvg.ntnu.no [mailto:owner-sam-us...@nvg.ntnu.no] On
Behalf Of Ian Spencer
Sent: 31 July 2009 15:11
To: sam-users@nvg.ntnu.no
Subject: Hi - just checking
 
Not heard anything on the group for quite a while so just thought I would
send a 'test' to check it's not me that's got a problem and say hi to
everyone.
I know you've all taken your Sam's to the beach and so no activity on the
group.
 
 
Ian
 
 


Hi - just checking

2009-07-31 Thread Ian Spencer
Not heard anything on the group for quite a while so just thought I would send 
a 'test' to check it's not me that's got a problem and say hi to everyone.
I know you've all taken your Sam's to the beach and so no activity on the group.


Ian