Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Position the Object.

Author
Message
LSM
13
Years of Service
User Offline
Joined: 30th Aug 2011
Location: Sweden
Posted: 31st Aug 2011 21:45 Edited at: 31st Aug 2011 23:41
Hi,
I got this http://pastebin.com/bxUFSNqv.
In it I position my Object (Gun) and my problem is not as much code related as it is math related.

I need help to modify it so that when i look up the gun will stay in position and not be in the middle right corner of the screen as when i look down. The gun isn't positioned as a real would. Now I solved so that when you look up the gun doesn't stray of (same with down) But I can't manage to solve this one.

Check positionweapons() function to see what I mean.
Project in rar file and code in pastebin.

Regards,
Thomas

Attachments

Login to view attachments
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 31st Aug 2011 23:28
I followed a tut series about FPS


http://www.youtube.com/watch?v=m48oX5Y5EVc


in that series he explain that thing you want with the gun and more.


Hope it helps

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
LSM
13
Years of Service
User Offline
Joined: 30th Aug 2011
Location: Sweden
Posted: 31st Aug 2011 23:41
Yea I'm more or less following that guy aswell

However im modifying hes code rather radical and when I came to this point I couldn't solve it ...
Fleep
14
Years of Service
User Offline
Joined: 1st Oct 2010
Location:
Posted: 1st Sep 2011 02:07
Lol i made that
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 1st Sep 2011 02:14
o.o really? nice tutorials

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Fleep
14
Years of Service
User Offline
Joined: 1st Oct 2010
Location:
Posted: 1st Sep 2011 02:38
Thanks if im not mistaken you asked me a few questions a while back on youtube.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 1st Sep 2011 12:02
Yes its true =D but i quit fps, im starting from the beginning

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
LSM
13
Years of Service
User Offline
Joined: 30th Aug 2011
Location: Sweden
Posted: 1st Sep 2011 12:33
I'm prob the one that asked most questions ^^ But this wasn't your part of the game its a moddification so I thought i would ask in here.
Great Tut
LSM
13
Years of Service
User Offline
Joined: 30th Aug 2011
Location: Sweden
Posted: 1st Sep 2011 17:15
I simply want the gun to move up and down abit according to how much up/down you look.

Come from PHP and VB 6.0, VBA Thought I would give it a try...
Now im a good programmer just not that good with math
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 2nd Sep 2011 04:57
Make a function that takes the camera angle and sets the guns position
appropriate to that angle. That is a very simple and crude way to do it.
LSM
13
Years of Service
User Offline
Joined: 30th Aug 2011
Location: Sweden
Posted: 2nd Sep 2011 18:04
Yea that is pritty much what I got (positionWeapond())

Check the pastebin Or isn't that what you meant?

Come from PHP and VB 6.0, VBA Thought I would give it a try...
Now im a good programmer just not that good with math

Login to post a reply

Server time is: 2024-10-02 19:15:26
Your offset time is: 2024-10-02 19:15:26