View previous topic :: View next topic |
Author |
Message |
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 3:40 am Post subject: My engine is geting no where. |
|
|
I've been looking up tutorials on the mouselook for glut and also tutorials for collision dectection. IT's all hard to understand. I feel that i need to get these two thing's out of the way before it goes full steam ahead. Just really frustrating.
The problem's with other engines, its it would take too much time to understand them. They are complex, i'm just wanting something very simple. |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Feb 22, 2005 4:50 am Post subject: |
|
|
Check nehe and gametutorials.com The tings you mention are covered there. |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 5:00 am Post subject: |
|
|
Vampyre_Dark wrote: |
Check nehe and gametutorials.com The tings you mention are covered there. |
http://www.gametutorials.com/ is now charging for their tutorials 5 dollars.
I'll try nehe.. |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Feb 22, 2005 5:09 am Post subject: |
|
|
banshee777 wrote: |
Vampyre_Dark wrote: |
Check nehe and gametutorials.com The tings you mention are covered there. |
http://www.gametutorials.com/ is now charging for their tutorials 5 dollars.
I'll try nehe.. |
ROFL, when the hell did that happen? Their stuff is so subpar. |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 6:48 am Post subject: |
|
|
If anyone has code that using glulookat or glrotate and translate going.
Doing mouse look, rotate around, strafing pls let me know. |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 6:49 am Post subject: |
|
|
Vampyre_Dark wrote: |
banshee777 wrote: |
Vampyre_Dark wrote: |
Check nehe and gametutorials.com The tings you mention are covered there. |
http://www.gametutorials.com/ is now charging for their tutorials 5 dollars.
I'll try nehe.. |
ROFL, when the hell did that happen? Their stuff is so subpar. |
No idea, last i went there it was free...mabe 4 months ago |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Feb 22, 2005 6:53 am Post subject: |
|
|
A brief history:
-Here we are!
-Oops we got hacked!
-look we have content!
-Oops, we got hacked
-Tutorial writer leaves
-Oops we got hacked!
-Oops, we got hacked again!
-Dammit, more hacking!
-*crickets for two years*
-BUY OUR SHIT!
However, you may find this usefull.
http://ultimategameprogramming.com/index2.php |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 7:44 am Post subject: |
|
|
Vampyre_Dark wrote: |
A brief history:
-Here we are!
-Oops we got hacked!
-look we have content!
-Oops, we got hacked
-Tutorial writer leaves
-Oops we got hacked!
-Oops, we got hacked again!
-Dammit, more hacking!
-*crickets for two years*
-BUY OUR SHIT!
However, you may find this usefull.
http://ultimategameprogramming.com/index2.php |
His got lines two pages of code, tone of math's...just for the camera might as well..brain melts. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Tue Feb 22, 2005 7:57 am Post subject: |
|
|
*lol* at Vampyres nice little analysis of the 'short history of gametutorials.com'.
Banshee, instead of going through all the trouble of doing it with those basic opengl functions, most of us took the more flexible way of implementing a camera class, featuring at least:
1. Yaw, Pitch and Roll (fix yaw axis for 'freelook-style' mouse)
2. MoveRelative (relative to current orientation, perfect for strafing and moving forward/backward)
Then every frame you let that camera class spit out a ViewMatrix which you can then toss into OpenGL using glLoadMatrixF.
Yes, that is a lot of work, but no-one ever said programming a fps was easy if you don't want to use 3rd party stuff
You are welcome to have a look at my code if you want, but it's Delphi, and you will have to realize that a Matrix, Quaternion AND camera class are involved. Probably just as complicated as the 3d engine stuff you peeked at before. |
|
Back to top |
|
|
Jeroen Site Admin
Joined: 07 Aug 2004 Posts: 5332 Location: The Netherlands
|
Posted: Tue Feb 22, 2005 8:00 am Post subject: |
|
|
Just for the record: what exactly do you mean by getting "hacked"? Their stuff was free and I see no reason to hack such a site... |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 8:10 am Post subject: |
|
|
Paul-Jan wrote: |
*lol* at Vampyres nice little analysis of the 'short history of gametutorials.com'.
Banshee, instead of going through all the trouble of doing it with those basic opengl functions, most of us took the more flexible way of implementing a camera class, featuring at least:
1. Yaw, Pitch and Roll (fix yaw axis for 'freelook-style' mouse)
2. MoveRelative (relative to current orientation, perfect for strafing and moving forward/backward)
Then every frame you let that camera class spit out a ViewMatrix which you can then toss into OpenGL using glLoadMatrixF.
Yes, that is a lot of work, but no-one ever said programming a fps was easy if you don't want to use 3rd party stuff
You are welcome to have a look at my code if you want, but it's Delphi, and you will have to realize that a Matrix, Quaternion AND camera class are involved. Probably just as complicated as the 3d engine stuff you peeked at before. |
]
I've given up so many times.
if anywants to have look at the engine all 792 lines
ftp://knight777.hopto.org/banshee3_traingle_render39.cpp
|
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Tue Feb 22, 2005 8:11 am Post subject: |
|
|
Defacing? |
|
Back to top |
|
|
Mr.Fletcher DeleD PRO user
Joined: 07 Aug 2004 Posts: 1772 Location: Germany
|
Posted: Tue Feb 22, 2005 8:27 am Post subject: |
|
|
banshee777 wrote: |
If anyone has code that using glulookat or glrotate and translate going.
Doing mouse look, rotate around, strafing pls let me know. |
Setting the camera to opengl:
Code: |
PROCEDURE TCamera.SetView(pRotate, pTranslate : Boolean);
BEGIN
if pRotate Then Begin
glRotatef(rx,1,0,0);
glRotatef(ry,0,1,0);
end;
if pTranslate Then Begin
glTranslatef(-PosX,-PosY,-PosZ);
End;
END; |
Rotating the camera by mouse (deltax/deltay are the difference between current and last mouse coordinates)
Code: |
ry := ry + DeltaX / 5;
rx := rx + DeltaY / 5;
if rx >90 then rx:=rx - abs(deltaY) / 5;
if rx <-90 then rx:=rx + abs(deltaY) / 5;
if ry <0 then ry:=ry + 360;
if ry >360 then ry:=ry - 360; |
Applying movement keys to camera variables:
Code: |
FUNCTION TCamera.MakeLookVector(pX : single) : TVector; //Sub-Routine
BEGIN
Result[0] := Sin((ry+pX)*Pi/180);
Result[1] := -Sin((rx)*Pi/180);
Result[2] := -Cos((ry+pX)*Pi/180);
END;
PROCEDURE TCamera.Move(pV : Single; Speed : single);
VAR V : TVector;
BEGIN
V := MakeLookVector(pV);
PosX := PosX + V[0] * Speed;
PosY := PosY+ V[1] * Speed;
PosZ := PosZ + V[2] * Speed;
END; |
Comments to the last code:
pV is the angle of which you want to move the camera. if pv is 0, you'll move straight forward, if its -90, you'll move left, 90=right and 180 = backwards.
It's Delphi code, but i hope, it helps you.
And don't give up
Some wise men said, your first engine will never be finished. But it will surely help you to learn programming 3d applications. _________________ Behold! The DeleD Wiki! Please help us expanding it
DeleD on IRC
Last edited by Mr.Fletcher on Tue Feb 22, 2005 12:27 pm; edited 1 time in total |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Tue Feb 22, 2005 9:33 am Post subject: |
|
|
Jeroen wrote: |
Just for the record: what exactly do you mean by getting "hacked"? Their stuff was free and I see no reason to hack such a site... |
I had often checked that site for updates in the past. They were always posting about being down because they were hacked, and their files got virus infections and all kinds of soap opera drama. |
|
Back to top |
|
|
banshee777 Member
Joined: 10 Feb 2005 Posts: 37
|
Posted: Tue Feb 22, 2005 1:19 pm Post subject: ... |
|
|
glutMotionFunc (mouse);
I believe this function is useless fo ar 3d shooter, i think it can't reset to the middle of screen.
I'm going to need another function to get the mouse going on this. |
|
Back to top |
|
|
|