• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Quaternion Rotation

Status
Not open for further replies.
Level 19
Joined
Feb 4, 2009
Messages
1,313
this makes stuff spin around its z-axis
Code:
        0: { 0, 0, 0, 1 },
            InTan { 0, 0, 0, 1 },
            OutTan { 0, 0, 0, 1 },
        90: { 0, 0, 0.707107, 0.707107 },
            InTan { 0, 0, 0.731894, 0.681418 },
            OutTan { 0, 0, 0.731894, 0.681418 },
        180: { 0, 0, -1, 0 },
            InTan { 0, 0, 0.996917, 0.078459 },
            OutTan { 0, 0, 0.996917, 0.078459 },
        270: { 0, 0, 0.707107, -0.707107 },
            InTan { 0, 0, -0.67559, 0.737277 },
            OutTan { 0, 0, -0.67559, 0.737277 },
        360: { 0, 0, 0, -1 },
            InTan { 0, 0, 0, -1 },
            OutTan { 0, 0, 0, -1 },
I want it to spin around its x- or y- axis
how to do that?

I tried it by using an "Euler to Quaternion"-calculator but it seems like I know far to less to use it properly
how do I have to change the values to make it rotate like I want?
(this is spinning around an attachment point
how do I make the attachment point shift its position depending on the attached units size?)

this code contains unnecessary stuff but I did not know how and what to remove and I grew tired of trying what does what so I went here to ask some smart people how to :grin:
Code:
Version {
    FormatVersion 800,
}
Model "CycloneTarget" {
    NumHelpers 2,
    NumAttachments 2,
    BlendTime 150,
}
Sequences 3 {
    Anim "Birth" {
        Interval { 2233, 3333 },
        NonLooping,
        MaximumExtent { 0, 0, 150 },
    }
    Anim "Stand" {
        Interval { 6867, 10133 },
    }
    Anim "Death" {
        Interval { 13467, 18467 },
        NonLooping,
    }
}
GlobalSequences 2 {
    Duration 360,
    Duration 360,
}
Helper "dummy spin" {
    ObjectId 0,
    Rotation 5 {
        Hermite,
        GlobalSeqId 0,
        0: { 0, 0, 0, 1 },
            InTan { 0, 0, 0, 1 },
            OutTan { 0, 0, 0, 1 },
        90: { 0, 0, 0.707107, 0.707107 },
            InTan { 0, 0, 0.731894, 0.681418 },
            OutTan { 0, 0, 0.731894, 0.681418 },
        180: { 0, 0, -1, 0 },
            InTan { 0, 0, 0.996917, 0.078459 },
            OutTan { 0, 0, 0.996917, 0.078459 },
        270: { 0, 0, 0.707107, -0.707107 },
            InTan { 0, 0, -0.67559, 0.737277 },
            OutTan { 0, 0, -0.67559, 0.737277 },
        360: { 0, 0, 0, -1 },
            InTan { 0, 0, 0, -1 },
            OutTan { 0, 0, 0, -1 },
    }
}
Helper "dummy two spin" {
    ObjectId 1,
    Rotation 5 {
        Hermite,
        GlobalSeqId 1,
        0: { 0, 0, 0, 1 },
            InTan { 0, 0, 0, 1 },
            OutTan { 0, 0, 0, 1 },
        90: { 0, 0, 0.707107, 0.707107 },
            InTan { 0, 0, 0.731894, 0.681418 },
            OutTan { 0, 0, 0.731894, 0.681418 },
        180: { 0, 0, -1, 0 },
            InTan { 0, 0, 0.996917, 0.078459 },
            OutTan { 0, 0, 0.996917, 0.078459 },
        270: { 0, 0, 0.707107, -0.707107 },
            InTan { 0, 0, -0.67559, 0.737277 },
            OutTan { 0, 0, -0.67559, 0.737277 },
        360: { 0, 0, 0, -1 },
            InTan { 0, 0, 0, -1 },
            OutTan { 0, 0, 0, -1 },
    }
}
Attachment "Sprite First Ref" {
    ObjectId 2,
    Parent 0,
    Translation 1 {
        Hermite,
        6867: { 0, 0, 0 },
            InTan { 0, 0, 0 },
            OutTan { 0, 0, 0 },
    }
    AttachmentID 0,
}
Attachment "Sprite Second Ref" {
    ObjectId 3,
    Parent 1,
    AttachmentID 1,
}
PivotPoints 4 {
    { 0, 0, 0 },
    { 0, 0, 0 },
    { 0, 0, 0 },
    { 0, 0, 0 },
}

for infos why I want to do it go here:
http://www.hiveworkshop.com/forums/...lone-abuse-cyclone-for-rotating-units-139232/
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
I don't really know the answer to thiq, but I would open up MAX, rotate something around the desired axis, export it using NeoDex and check the code of the mdl file and then try to understand how it works ....

T.

I once installed it on my old pc a long time ago and it was an epic struggle doing it

however this should be an animation and not static stuff (and I would have to learn how to animate rotating attachment points in dmax and I only found bone-concerning tutorials)

thx anyway

gonna try a bit more
maybe I will be lucky x)
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
if all you want to do is switch the axi from z to x, do this:

Code:
270: { 0, 0, 0.707107, -0.707107 },
turns into

Code:
270: { 0.707107, 0, 0, -0.707107 },

does not work :(

now the unit turns around instantly when the frame is reached (not sure about it because it's a little fast but changing it to slow to see that it does not work would not make lots of sence anyway)

however thanks for response this far
 
does not work :(

now the unit turns around instantly when the frame is reached (not sure about it because it's a little fast but changing it to slow to see that it does not work would not make lots of sence anyway)

however thanks for response this far

did you turn the tangents as well?
 
perfect :D

now it is possible to rotate units without creating a thousand dummys for all of them :thumbs_up:

+rep of cause

you mean rotating in the pitch and roll?

here's the dummy model. To set the angle of rotation just play the animation by index and add 90.

The first animation sets angle -90 and the last animation sets angle +90, 181 animations in total, being animation 91 the 0º.
 

Attachments

  • !RotationDummy!.mdx
    28.2 KB · Views: 65
Level 19
Joined
Feb 4, 2009
Messages
1,313
you mean rotating in the pitch and roll?

here's the dummy model. To set the angle of rotation just play the animation by index and add 90.

The first animation sets angle -90 and the last animation sets angle +90, 181 animations in total, being animation 91 the 0º.

are you insane???? 90 animations!!! oO

how shall I rep them all :cry:

well...thx again

you might add this to the modelling section and say that it is very useful together with cyclone

unfortunately I can't make some badass spell with it instantly because I am out of time tomorrow and it' a little late at here already but there is work in progress :thumbs_up:

edit:
damn it!
just figured out that you can't set animation by index of cyclone oO

edit2;
testet it ingame
rotation is bugged or weird or does not work properly without setanimationbyindex
 
Status
Not open for further replies.
Top