Mathlib v2
Moderator: InsideQC Admins
38 posts
• Page 3 of 3 • 1, 2, 3
Uploaded revised bugfix version.
Also adds damage level tweaks for forte scale blaster and demicannon. See original post for download links.
Also adds damage level tweaks for forte scale blaster and demicannon. See original post for download links.
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
Oh yeah?
FrikaC wrote:Quake Matt wrote:One thing I would like to see is matrix maths, for rotations and other transformations. I'd suggest quaternions, too, but I can't get my head round them!
Now lets not get crazy here.
LH wrote that very kind of code to dpmod a good ol' while back, and should definitely be included in mathlib. What the code does is store orientation using matrices, and rotation using axisangle (aka rodrigues vector among other names). What it's lacking is a matrix->euler conversion function, to actually show off the cool maths going on behind the screen. I've recently been working on expanding the use of this code, and making it available for more general use (it has a very specific use in dpmod, which isn't even finished). I've done tests to prove it works, and plan to use it for some cool physics stuff and whatnot, and would be glad to incorporate it into mathlib.
I need help though, I need an Arc cosine function, which in turn requires both an Arc sine and a Logarithm function, as far as I understand. I also need help with the matrix->euler conversion, as I have no idea what I'm actually doing.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Re: Oh yeah?
Urre wrote:I have no idea what I'm actually doing.
Neither do I.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
LH implemented arc cos among others as a builtin to DP, so now I got stuff going on. Does obviously unfortunately not work in regular quake
Still hunting for some matrix->euler magic though...
EDIT: found code in dpmod which did this, so the matrix stuff is working now. If anyone cares I can post it here, just make some noise. Otherwise I'll just keep and use it for myself until I have a mod to show it off in. Note that it's DP only, unless you don't care about a function which finds the angle between two vectors. If you can live without that it should work in any quake engine.
Still hunting for some matrix->euler magic though...
EDIT: found code in dpmod which did this, so the matrix stuff is working now. If anyone cares I can post it here, just make some noise. Otherwise I'll just keep and use it for myself until I have a mod to show it off in. Note that it's DP only, unless you don't care about a function which finds the angle between two vectors. If you can live without that it should work in any quake engine.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Urre wrote:LH implemented arc cos among others as a builtin to DP, so now I got stuff going on. Does obviously unfortunately not work in regular quake
Still hunting for some matrix->euler magic though...
EDIT: found code in dpmod which did this, so the matrix stuff is working now. If anyone cares I can post it here, just make some noise. Otherwise I'll just keep and use it for myself until I have a mod to show it off in. Note that it's DP only, unless you don't care about a function which finds the angle between two vectors. If you can live without that it should work in any quake engine.
Arccos is basically available in quake once you have the sqrt function, and if you have sqrt as a builtin it's only two builtin calls.:
- Code: Select all
float arccos(float r) =
{
local vector t;
t_x = r;
t_y = sqrt(1 - r * r);
return vectoyaw(t);
}
I hope I've got the components the right way round in this one, you may have to switch the x and y components about or multiply by -1 on one of the components. Arctan is even easier, as it doesn't need the sqrt function, just set the adjacent compontent of t to 1 and the opposite to r.
- Preach
- Posts: 122
- Joined: Thu Nov 25, 2004 7:20 pm
That's cool Preach! If that works it'd work just fine in any quake engine.
Just realised mathlib.qc (with trigonometry) is something that should've been available when qc was popular, to prove the strengths of qc.
Just realised mathlib.qc (with trigonometry) is something that should've been available when qc was popular, to prove the strengths of qc.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Does anyone know of a working link to Dr. Shadowborg's mod? I'd like to try it.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
Wazat wrote:Does anyone know of a working link to Dr. Shadowborg's mod? I'd like to try it.
http://tlb.quakedev.com/files/mlx20b.zip
This is actually an embarassment now.
Also, you should try this with the IKSPQ series of maps:
http://tlb.quakedev.com/files/drsgv1.zip
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
38 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest