The Big Trig Question

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
ok, heres my problem, i want to get the rotator between 2 vectors. seems like it should be easy, but the only way i see of doing it is using the dot product. unfortunatly this returns the cosine of the angle between the vectors... which i can't convert to a rotator without an ArcCos function, which UT doesn't seem to provide. am i missing something obvious here? please help! im going to stay up till someone tells me how to do this, so i can carry on with my late night coding session :) now wheres my pepsi max and extra large pizza, sure i left it here somewhere... :)

Ben
 

TaoPaiPai

Commisaire Van Loc
Jun 13, 2000
1,626
0
0
Matnik
Visit site
I had the same problem ,here's the method I used:
I created a vector V from point A to point B (vector V=vector b-vector a) then converted it to a rotator R=rotator(V).Afterward I think you have to convert each of the rotation values (p,y,r) to value%65535 to make sure your number is in the correct range.
Gimme Pizza.
 

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
thanx, got it sorted now, it was, as usual, a really stupid mistake on my part.. Doh! anywayz, heres a pic of what you helped me finish :). Its a (now accurate) Terminator style laser sight mounted on a helmet. i plan on having the helmet as a pickup item with laser sight, night vision, flashlight, zoom, and maybe other things if i think of them, all toggled with a button. which leads me onto my next question... is it possible to draw meshes on the hud like the weapons, or is this all crazy native code for the weapon class?

heres the pick, notice also the smoke coming from the minigun after i fired it another adition of mine :)
 

TaoPaiPai

Commisaire Van Loc
Jun 13, 2000
1,626
0
0
Matnik
Visit site
Yes you can draw a mesh onto the HUD !

Use the function canvas.drawActor(actor,someBoolean)

I don't know the use of someBoolean but it is set to false for weapons.

I think you have to adjust some of the default properties of your actor to have it render correctly on your display (such as x and y offset variables,first person mesh,etc...I don't know the exact names for these variables,take a look at the code from some weapon)
I've never tried so don't know if it works.
 

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
arrgggg! this is so frustrating! i've done everything i need to get this working and its not! basicly, ive got an inventory item that i want to display a mesh on the hud. the inventory class has this cabability built in, but i've set all the properties right and it doesn't work, and i've tried overriding the renderoverlays function, still to no effect. if anyone has managed to get this working, please let me know how!
 

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
sorry, i gave up trying :( when i finnally got the mutator to take postrender() calls, the canvas functions would only sort-of work, and canvas.drawactor() wasn't working at all. so i've given up of this funky item idea, and am probably just going to release it as it looks in the first screenshot. check the modsquad beta test forum if you wanna test it for me :)
 
OK, about drawing meshes on HUDs, here is how it works:
The RenderOverlays(...) function in the weapons class positions the weapon in the location where you see it. All that the DrawActor(...) function does is it makes the weapon mesh visible to the player who's canvas calls it (by default its hidden), so all you have to do to have your inventory item get drawn on the HUD is position it in front of the players "eyes" (making sure to make it really close to the viewport/"eyes" and small so that it doesnt intersect with geometry and other actors) and do the DrawActor(...) thing. If you're having trouble positioning it, just copy the RenderOverlays(...) code over from the weapon class. If you're still having trouble, get more pizza, soda, and whatever else helps you think. And no, I'm not just saying that because of my name.

[EDIT]
Oh, and now I have a question for you: how did you do that laser? Is it just a bunch of little actors in a line? Are they sprites or meshes? I've been trying for a while to figure out the best way of making lines in UT... thought I might add your technique to my collection :).

[EDIT]
Oh, and about that rotator-between-2-vectors... Some people really need to start thinking A LOT LESS. I was reading the thread and wondering when someone would finally figure out the obvious...

Eater.
 

TaoPaiPai

Commisaire Van Loc
Jun 13, 2000
1,626
0
0
Matnik
Visit site
You know I am intelligent enough to see when you can simplify an algorythm,I was just trying to be explicit so I didn't make the simplification so that elffum can understand the principle of the method used.
Otherwise I wouldn't have missed rotator (vector-vector) and even if I missed it it wouldn't be such a big deal.
 

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
Originally posted by Eater1
[EDIT]
Oh, and now I have a question for you: how did you do that laser? Is it just a bunch of little actors in a line? Are they sprites or meshes? I've been trying for a while to figure out the best way of making lines in UT... thought I might add your technique to my collection :).
Eater. [/B]

hehe, its essentially the alt-fire of the pulsegun, but changed beyond all recognition :) it is indeed a line of meshes, using the pbolt mesh that the pulsegun uses, but with a different skin. if you want, check this post, download and check the code out in unreal-ed or something, go on, its not cheating if i give you pemission :) oh, about the rotator thing, i know, im really dumb sometimes :)
 

eXoR

Lead coder
Oct 22, 2001
36
0
0
38
Holland
exorcist.gamepoint.net
Originally posted by elffum
heres the pick, notice also the smoke coming from the minigun after i fired it another adition of mine :)

Sorry for the Off Topic post but eh, I noticed that's my mutator you're running there when taking that screenie :) May I ask what you're planning to do with it ?
 

elffum

New Member
Oct 23, 2001
43
0
0
41
Reedham
Visit site
Originally posted by eXoR


Sorry for the Off Topic post but eh, I noticed that's my mutator you're running there when taking that screenie :) May I ask what you're planning to do with it ?

you mean the bullet time mutator? i was just using it cos its damn fun :)

btw, i checked out ur site, and the new version of bullet time sounds sweet, are u gonna release it soon? i soooo want to see bullets wizzing past my face in tac-ops :)
 
Last edited:

eXoR

Lead coder
Oct 22, 2001
36
0
0
38
Holland
exorcist.gamepoint.net
Bullet Time in a French mag ? Coool ! Do you by chance have a scanner ? If so, could you please scan the part of the mag that's about Bullet Time for me ? Plzz ?? :)

Also, version 2.0 has been ready for two weeks or so, but I'm only waiting for the site to finish now and I have to tweak Tactical Ops compatibility because they released a new version that screws everything up :)

But, I'm working on it. Expect a new version within the next 2 weeks.