1 registered members (AndrewAMD),
1,244
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Moving camera betwen two vector
[Re: WretchedSid]
#443882
07/27/14 12:58
07/27/14 12:58
|
Joined: Jun 2010
Posts: 71
LawnmowerMan
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2010
Posts: 71
|
You are now smart or what? What math can help me if I do not know what engine function to use? Did you read my question? What function I should use? I am not a coder, and I am not smart like you, I just asked for help here in STARTING WITH GAMESTUDIO, and if you do not want to help, simply leave my post alone.
|
|
|
Re: Moving camera betwen two vector
[Re: LawnmowerMan]
#443884
07/27/14 13:24
07/27/14 13:24
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
You are now smart or what? Not just now! I was also smart 5 minutes ago. At least, I like to pretend I'm smart, truth be told, if I remember how to add up two numbers correctly without using a calculator, it's been a successful day for me. I hate "please google shit for me" requests though, because that is what you are asking. You are asking us to google for you how to interpolate between numbers, but you didn't even give any information about what kind of acceleration curve you want or anything. So I rolled a dice for you and picked one for you. Behold, math:
result = _startValue + (-_difference / 2.0 * (cos(pi * time / _duration) - 1.0));
It's pesudo code (actually it's C++ and taken out of Rayne, but it might as well be pseudocode for Lite-C). _startValue, result and _difference are VECTOR. _difference is the difference between start and end, time is the delta into the animation and _duration is the duration of the animation.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Moving camera betwen two vector
[Re: WretchedSid]
#443886
07/27/14 14:09
07/27/14 14:09
|
Joined: Jun 2010
Posts: 71
LawnmowerMan
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2010
Posts: 71
|
This has nothing to do with "please google shit for me" requests. I'll try to explain better. We have two entities that are located in the level - entity START and entity END. I need some advice about how to make the camera moves between these entities something like
if(camera.y < entityEND.y)
{
camera.y += 10 * time_step;
}
OK, this can work if camera.z and entityEND.z have the same height cordinates. If entityEND is above entitySTART (from where camera start) then I do not know how make this. I tried with vec_diff, but I do not know how move together camera.y and camera.z to hit entityEND. With path this is easy but i need solution without path.
|
|
|
Re: Moving camera betwen two vector
[Re: LawnmowerMan]
#443887
07/27/14 14:11
07/27/14 14:11
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
I literally gave you code for that. Seriously, it's math. There is no magic Engine function. And it IS a "google for me, plox" request.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Moving camera betwen two vector
[Re: WretchedSid]
#443889
07/27/14 14:24
07/27/14 14:24
|
Joined: Apr 2005
Posts: 1,988 Canadian, Eh
DLively
Serious User
|
Serious User
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
|
Not just now! I was also smart 5 minutes ago. At least, I like to pretend I'm smart, truth be told, if I remember how to add up two numbers correctly without using a calculator, it's been a successful day for me. LMFAO!!!!! And it IS a "google for me, plox" request. I agree with JustSid. If your looking for a request you're in the wrong section of this forum. AND the im not a 'coder' doesnt fly. If you're looking to make a game, then you should work on your programming skills. Moving the camera from one point to the other is VERY simple.
if(camera.y < entityEND.y)
{
camera.y += 10 * time_step;
}
You're on the right track, but if you are looking for height differences, you'll need to use all 3 of the cameras vector points (x,y, AND Z) and some more math.
Last edited by DLively; 07/27/14 14:25.
|
|
|
Re: Moving camera betwen two vector
[Re: LawnmowerMan]
#443893
07/27/14 15:53
07/27/14 15:53
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Cool. Ping us when you find out that it requires math for the acceleration you were looking for.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|