home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Turnkey

by chmmr213 on 03/09/2007 20:41, 7 messages, last message: 03/16/2007 21:24, 1318 views, last view: 04/11/2024 01:19

OK to start out.. excellent engine IMHO.

I was able to make the arrow keys rotate the player up to down and left to right just using the built in pl->yaw and pl->pitch. You know, make the binded commands like pitchup and pitchdown. Also new char like t_turn and t_pitch and new bools so the code ended up looking like this..

dir(pitchup,t_pitch,-1,k_dwn,k_uup);
dir(pitchdown,t_pitch,1,k_uup,k_dwn);
dir(yawleft,t_turn,1,k_lft, k_rght);
dir(yawright,t_turn,-1,k_rght,k_lft);

Then later on force the movement to happen in another function like modifyvelocity or what have you;

pl->yaw += pl->t_turn;
pl->pitch += pl->t_pitch;
fixcamerarangeang();

To compensate so the camera follows tighter I fudged what you did with fixcamerarange and actually made it to be sure to follow the yaw and pitch the player is at.

Now this is all fine and dandy and makes me realize that you dont have it because you dont want it in your game which is something one must respect.

As far as what I just bumbled together up there it works fine for a first person shooter because the views and angles are locked at max and mins before the formula would have the opposite effect desired. IE when the -1 or positive 1 would flip it when yawing at a certain pitch degrees... gimbal lock I believe...........I am coding a space game with your great engine.

You do have something that will rotate_around_z, _x, _y, but sadly when using the pl->, there is no x,y,z indicated as an option from the physent. Anyhow, I think you can quess my next question... Is there a function that is already in here that will give the player entity's x,y and z axis so I may rotate upon it or will I need to create the process to find that x,y,z axis? I am fairly certain that of course the player entity has an x,y,z so that is why I ask this more than likely stupid question.


   Board Index   

#1: no prob

by chmmr213 on 03/13/2007 16:09

I will just work on it myself. Thank you for your time and effort.

reply to this message

#2: Re: no prob

by tentus_ on 03/14/2007 00:24, refers to #1

I think everyone was too intimidated by the wording to help you. Not many of us are very confident with this level of coding (Aard and eihrul etc being obvious exceptions).

reply to this message

#3: and..

by Aardappel_ on 03/14/2007 00:30

just because a feature is trivial to add (keyboard based rotation) doesn't mean we care for adding it. This topic has been discussed over and over.

reply to this message

#4: Re: no prob

by Quin on 03/14/2007 04:23, refers to #2

I understood what he was saying, but I knew that this would indeed be deemed a frivolous and unecessary feature.

Not to mention the fact that I have already done this in the past while testing Sauerbraten's usability for different game types such as an adventure (a-la Mario 64, etc) game. I've even gone as far to totally rework the movement logic for use with a Wii Remote.

Things like this aren't necessary for Sauerbraten, but are indeed useful to the Modding Community. Make a release on http://quadropolis.us/ with some well written documentation, then you might find it gets used by others interested in the functionality, as we all have the option of modifying and compiling our own Sauerbraten client for things we specifically want but don't have.

reply to this message

#5: patch files

by rancor on 03/14/2007 06:56

My personal preferance would be for such modifications to be distributed as patch files. It makes things much simpler, and allows more then one modification in a given engine binary, since you can apply the patches you want and compile it yourself.

reply to this message

#6: Uh lost in the sauce I must say..

by chmmr213 on 03/14/2007 16:23

Thank you for the appropriate link to http://quadropolis.us/. That is a much better place for my not so clearly posted, while indeed different, question about bypassing gimbal lock.... Of course by now I have spent many hours on it and with heavy heart will try my damndest to incorporate Quaternion math for the 3d space game movement to beat the dreaded gimbal lock /cry me... Oh well ... Thanks again for the link.

reply to this message

#7: Re: Uh lost in the sauce I must say..

by ethan592 on 03/16/2007 21:24, refers to #6

quaternions are your friend but kinda hard to wrap your head around at first

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53870474 visitors requested 71645676 pages
page created in 0.010 seconds using 10 queries
hosted by Boost Digital