Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - irrel

Pages: 1 [2] 3 4
16
i always forget this is a thing until after nominations close - thanks for nominating me tho makes me feel nice :^)

17
General Discussion / Re: We missed Blockland's 15th birthday
« on: November 16, 2019, 08:21:23 PM »
stuffpost reply

18
General Discussion / It's coming.
« on: September 08, 2019, 12:54:08 AM »

19
Add-Ons / Re: Event_EmitterTransform
« on: August 16, 2019, 08:53:56 PM »
this is really neat, makes builds a lot more flexible with emitters

20
Faces, Decals, Prints / :^)
« on: June 12, 2019, 12:21:37 AM »

21
forget yeah

22
Add-Ons / Re: [Brick] Microheads
« on: January 30, 2019, 06:31:32 PM »
blockland board game when

23
Modification Help / Support_IrrelWeaponSpread
« on: October 31, 2018, 08:55:01 PM »
a good weapon spread system for once

supports:
  • raycasting
    • projectile behavior makes your rays act like rockets if you want
    • projectile tracers so you can visually approximate the ray
    • projectile dropping so you can drop a grenade at the end of a ray
    • maximum ray length so you can decide how far away to hit
    • typemasks to show off your wallhacks by shooting your friends through everything
  • projectiles
    • shoot multiple different projectiles at the same time
    • or just use the spread stuff, that's cool too
    • seriously projectiles aren't that complicated, there's not much to put here
  • functional spread
    • pass some weird stuff to your spread values
    • or just make the spread larger when you move
  • advanced spread settings
    • radius, so you can decide how much you want to miss by
    • centeredness, so you can decide how often you miss
    • distance, so you can decide exactly where you'll miss
  • weapon image properties
    • tell your gun how it should usually act
    • allows overriding from arguments, so you can tell it to sit up straighter sometimes
  • return vectors
    • returns vectors used to fire the gun
    • handy for additional scripting

and probably more

give it a shot, download here (no pun intended)

ask in this topic about it if you're confused - i can help, but i might not be active here
you can also read the file itself, it contains some information
if you find any bugs, let me know and i'll update it

EDIT:
thanks to:
conan for being supremely helpful, always
metario for being also incredibly helpful even if he doesn't know it
trinko for being supportive and reminding me to update when i said i would
darksaber for telling me to fix a major bug and then helping me figure out what the bug was





24
Add-Ons / Re: [Vehicle] Dictator
« on: September 26, 2018, 09:58:42 PM »
haha me too thanks

25
Glad I was able to help even with my odd solution!

26
I keep reading lots of different things about quaternions and axis-angle representations, and they are definitely different. There appears to be multiple ways to convert between the two, so I'll keep reading and try to find the best one.
Do the rotations result in the shape still being normal to the face, or no?

EDIT: I feel a little stupid now. Just realized I should be doing vector addition. Replace
Code: [Select]
%quatCombined = %quatAngle1 * %quatAngle2 - vectorDot(%quatVector1, %quatVector2) SPC vectorScale(%quatVector2, %quatAngle1) + vectorScale(%quatVector1, %quatAngle2) + vectorCross(%quatVector1, %quatVector2);with
Code: [Select]
%quatCombined = %quatAngle1 * %quatAngle2 - vectorDot(%quatVector1, %quatVector2) SPC vectorAdd(vectorAdd(vectorScale(%quatVector2, %quatAngle1), vectorScale(%quatVector1, %quatAngle2)), vectorCross(%quatVector1, %quatVector2));

27
can you provide some details as to what's going wrong? or let me join your server? i'm likely misinterpreting something, and oversimplifying

28
Ok, so I did some more reading: apparently, quaternions are not the same as axis angle, but are very close.
Specifically, the unit quaternion (w, x, y, z) is equivalent to axis-angle (x, y, z, 2*cos-1(w)). In other words, we can pretty easily convert them to multiply them. However, they are not exactly equal, as the x, y, z part of the quaternion also has a factor of 2*sin-1(w) in it.

Here's some relatively simplified code that should do what you want. It'll be used exactly the same as the code I botched earlier.
Code: [Select]
function axisAngleToQuat(%rot)
{
%axis = getWords(%rot, 0, 2);
%angle = getWord(%rot, 3);

return mcos(%angle/2) SPC vectorScale(%axis, msin(%angle/2));
}

function quatToAxisAngle(%quat)
{
%axis = vectorNormalize(getWords(%quat, 1, 3));
%quatAngle = getWord(%quat, 0);

return %axis SPC 2*macos(%quatAngle);
}

function combineAxisAngleRotations(%rot1, %rot2)
{
%quat1 = axisAngleToQuat(%rot1);
%quat2 = axisAngleToQuat(%rot2);

%quatAngle1 = getWord(%quat1, 0);
%quatAngle2 = getWord(%quat2, 0);

%quatVector1 = getWords(%quat1, 1, 3);
%quatVector2 = getWords(%quat2, 1, 3);

%quatCombined = %quatAngle1 * %quatAngle2 - vectorDot(%quatVector1, %quatVector2) SPC vectorScale(%quatVector2, %quatAngle1) + vectorScale(%quatVector1, %quatAngle2) + vectorCross(%quatVector1, %quatVector2);

return quatToAxisAngle(%quatCombined);
}

29
Try inverting the argument order, maybe I misread something.

30
Axis-angle is a way of saying quaternion, so all we have to do is perform quaternion multiplication, where s1 and s2 are the scalars (i.e. the angles) and v1 and v2 are the vectors (i.e. the normals):

(s1 v2 + s2 v1 + v1 x v2, s1 s2 - v1 * v2) = R1R2

with * being vector dot product and x being vector cross product. This applies the rotation R1 before R2. This could be written in code as:

Code: [Select]
function combineAxisAngleRotations(%rot1, %rot2) {
%normal1 = vectorNormalize(getWords(%rot1, 0, 2));
%normal2 = vectorNormalize(getWords(%rot2, 0, 2));

%angle1 = getWord(%rot1, 3);
%angle2 = getWord(%rot2, 3);

return vectorScale(%normal2, %angle1) + vectorScale(%normal1, %angle2) + vectorCross(%normal1, %normal2) SPC %angle1 * angle2 - vectorDot(%normal1, %normal2);
}

Pages: 1 [2] 3 4