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 / FPS problem

Author
Message
Funkbrotha10
15
Years of Service
User Offline
Joined: 2nd May 2009
Location:
Posted: 8th May 2009 01:58
I still have not been able to position A weapon model with arms so that it is always in front of the camera. Can someone provide code samples

it was once said that a million monkeys at a million keyboards could re-produce the works of shakespear...
Now thanks to the internet we know that that is not true
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 8th May 2009 14:11
Try this. It should create a box in front of the screen, where a gun would be.

If you wanna import a weapon model, use dbLoadObject instead of MakeObject

DnB
15
Years of Service
User Offline
Joined: 28th Feb 2009
Location:
Posted: 12th May 2009 20:40
If you want something to be always in front of the camera try this


And you put that in your main loop of course. That is saying "always position object 2 (reconfigure as necessary) in from of the camera"
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 12th May 2009 20:45
No offence to DnB, but don't use his code. This would mess up as soon the the camera turned. Use this instead:


DnB
15
Years of Service
User Offline
Joined: 28th Feb 2009
Location:
Posted: 12th May 2009 21:16
Haha, you know I am using that code of mine in my game and in the game you dont turn. Your on a fixed path. But it works for that! And now that you mention it, I do have some camera glitches..
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 12th May 2009 21:46 Edited at: 12th May 2009 21:48
No offense to jezza, but don't use his code. This would mess up as soon as the camera turned. Use this instead:





Also that code will move the gun directly in front of the camera. If you want it to be positioned lower or to the side use dbMoveObjectRight()/Left()/Down() etc. as well.

i like orange
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 12th May 2009 22:03
you're right, I forgot that line. Silly old me. But of course I was sort of assuming that since its FPS you'd already set the rotation to that of the camera.

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 12th May 2009 22:12
Ya, I figured that much, but I couldn't help but point that out anyway.

i like orange

Login to post a reply

Server time is: 2024-10-01 01:33:07
Your offset time is: 2024-10-01 01:33:07