News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 17th Nov 2001, 06:30 PM   #1
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
The Big Trig Question

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
elffum is offline   Reply With Quote
Old 17th Nov 2001, 06:38 PM   #2
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
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.
TaoPaiPai is offline   Reply With Quote
Old 17th Nov 2001, 06:42 PM   #3
usaar33
Un1337
 
usaar33's Avatar
 
Join Date: Mar. 25th, 2000
Location: Unknown
Posts: 808
You are missing something obvious

rot=rotator(vector1-vector2);

usaar33 is offline   Reply With Quote
Old 18th Nov 2001, 06:15 AM   #4
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
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
__________________
Ben.
elffum is offline   Reply With Quote
Old 18th Nov 2001, 07:24 AM   #5
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
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.
TaoPaiPai is offline   Reply With Quote
Old 18th Nov 2001, 09:19 AM   #6
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
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!
__________________
Ben.
elffum is offline   Reply With Quote
Old 18th Nov 2001, 01:30 PM   #7
Captain Kewl
I know kewl.
 
Captain Kewl's Avatar
 
Join Date: Feb. 13th, 2001
Location: IN YOUR HOUSE
Posts: 794
I don't think RenderOverlays and PostRenders for non-weapon inventory items are polled. You might want to try putting it in a HUD.
Captain Kewl is offline   Reply With Quote
Old 18th Nov 2001, 05:33 PM   #8
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
thanks, i've but the postrender() stuff in a mutator and its working (sort of )
__________________
Ben.
elffum is offline   Reply With Quote
Old 19th Nov 2001, 04:52 AM   #9
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
Give us a screenshot
TaoPaiPai is offline   Reply With Quote
Old 19th Nov 2001, 08:51 AM   #10
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
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
__________________
Ben.
elffum is offline   Reply With Quote
Old 24th Nov 2001, 10:36 PM   #11
Eater1
Coder
 
Join Date: Oct. 22nd, 2000
Location: You really don't want to know... trust me...
Posts: 176
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.
Eater1 is offline   Reply With Quote
Old 25th Nov 2001, 11:06 AM   #12
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
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.
TaoPaiPai is offline   Reply With Quote
Old 26th Nov 2001, 12:47 PM   #13
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
Quote:
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
__________________
Ben.
elffum is offline   Reply With Quote
Old 26th Nov 2001, 12:53 PM   #14
eXoR
Lead coder
 
eXoR's Avatar
 
Join Date: Oct. 22nd, 2001
Location: Holland
Posts: 36
Quote:
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 ?
__________________
And he fired the harpoon.
All the anger and fury inside him exploded
If his chest had been a cannon, he would've fired his heart upon it.
eXoR is offline   Reply With Quote
Old 26th Nov 2001, 05:33 PM   #15
Eater1
Coder
 
Join Date: Oct. 22nd, 2000
Location: You really don't want to know... trust me...
Posts: 176
Ah... the pulse gun way... How come I didn't think of that.
*ducks out of sight before despute between elffum and eXoR regarding intellectual property turns into World War III*

Eater.
Eater1 is offline   Reply With Quote
Old 26th Nov 2001, 06:01 PM   #16
elffum
Registered User
 
elffum's Avatar
 
Join Date: Oct. 23rd, 2001
Location: Reedham
Posts: 43
Quote:
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
__________________
Ben.

Last edited by elffum; 26th Nov 2001 at 06:13 PM.
elffum is offline   Reply With Quote
Old 26th Nov 2001, 08:00 PM   #17
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
hey eXor ,they talked about your muti last month in a french videogames magazine
TaoPaiPai is offline   Reply With Quote
Old 27th Nov 2001, 08:33 AM   #18
eXoR
Lead coder
 
eXoR's Avatar
 
Join Date: Oct. 22nd, 2001
Location: Holland
Posts: 36
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.
__________________
And he fired the harpoon.
All the anger and fury inside him exploded
If his chest had been a cannon, he would've fired his heart upon it.
eXoR is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer