Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (Quad, alibaba, rki, 7th_zorro), 365 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 3 of 5 1 2 3 4 5
Re: Moving camera betwen two vector [Re: Emre] #443923
07/27/14 23:31
07/27/14 23:31
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Wow. This turned UGLY. Sorry to exasibate things everyone, but I'll just answer what was said in my direction, to defend my integrity.

Quote:
You agre with Mr. Sid. About what

You're asking the community to do your work for you.

Quote:
Did is ask for name of engine function request that I'm looking for someone to write complete code? What you guys talking about? You say that one word "vec_lerp" is that I ask for complete code?


You didn't ask for vec_lerp. You made a request. This is what you asked:

Quote:

How to make the camera moves between two vectors, first to start slowly and accelerate, and at the end to slow down? What function I should use?

Thanks


Thats a request in my books.

Now if you asked: "I have this code here that I've been playing around with, and have it to this extent, but I can't seem to get it to work because of this error..." that is asking for a bit of help.

All I said is if you want to request this, your in the wrong forum. But you posted here - Thus I will try to teach before I just give someone the answer so they don't know anything else than they did before.


Quote:

And what you call "useful help"


Quote:

Finally simple, short and useful answer.


Quote:
Your help I will not comment


I in no way said that asking for a request was wrong, or that it makes you less of an individual. I also didn't belittle you. Infact I was being encouraging.

Quote:

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.


So because you were too lazy to look into this a bit further, My help is useless, or of no help to you? If your not willing to learn, why would I write a full blown working snippit for you? Thats like saying You want to be rich but dont want to work for it, or even know how you got rich.

Quote:

You're here five years longer than me, and I'll bet you have no idea how to make this for what i ask.


Now thats a fucktard of a thing to say, comming from the person that knows nothing of what they are asking. If your going to try and insult my intelligence you'd better choose your bets more wisely - Because I'll bet the next time you ask for help, I wont - And I'll win both bets.

Quote:
I use 3dgs as a hobby because I'm not a programmer and it seems to easiest engine for me.

Now thats a piss in the wind. If you want to make games. LEARN TO PROGRAM. Infact learn all aspects of GAME CREATION. That is if thats what you want to do with your hobby. Or is your hobby to have others make games for you, so you can take the credit? I'm just a hobbiest myself. That doesn't mean im going to call myself and idiot and say I can't learn how to program so i need someone else to do it for me.

So before you go and insult someone that was trying to help you learn, think about what your intentions are - before you judge someone elses.

Quote:
or start making a some A8 game, why not.

I've completed my first full game some months ago, but due to some minor set backs I can't release it yet.

I've concluded You're really quick to make ASSumptions, and no longer worth my time.

Quote:
You guys are so rude.. and acting like a child. Seriously.. Clearly, LawnmowerMan is beginner and he need your help. All he need is formula&function. If you don't want to help that guy, just don't do it. No one is forcing you.


I have no beef with you Emre, I like you. But I would like to say I suppose teachers acting childish when they mark homework then? No. The more effort you put in, the better the results you get.

Quote:

and all you guys are doing is dragging this into off-topic and are rude.


and once again, I am agreeing with WretchedSid.

Peace.

Last edited by DLively; 07/27/14 23:58.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Moving camera betwen two vector [Re: DLively] #443936
07/28/14 08:37
07/28/14 08:37
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
God, just stop all this bullshit, it's getting ludicrous.

Here's the damn code (I dind't test it), make sure you understand it.
Code:
float p = ...; // blending percentage, range [0...1]


p = 0.5 - cos(p * 3.141592) / 2.0; // apply smooth falloff
vec_lerp(vPos_Output, vPos_Start, vPos_End, p);



POTATO-MAN saves the day! - Random
Re: Moving camera betwen two vector [Re: DLively] #443937
07/28/14 08:49
07/28/14 08:49
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Quote:
you'll need to use all 3 of the cameras vector points (x,y, AND Z) and some more math

Man thank you, I did not know that there is a vector x, this really help me. Programming has something with math? Man thanks again.

And WTF if I ask for help? Hey, do you hear yourself?!

To be honest and real, first a gigant arrogance in first answer from Mr. Sid, then you and Sid attacked me without any reason that I am parasite that requires from you to write code for me. And this is all truth, only you and Sid can not see this. That's not a way how you and Sid can talk with me or anyone else. I just ask HOW and this is reason why this forum exist. Who you are guys to judge about anything here? Superku simply give me answer and what is the problem? He has knowledge, he spent a few seconds to answer, and milion thanks for all what he do for this community.

@Kartoffel
Quote:
God, just stop all this bullshit, it's getting ludicrous

Man you're totally right. I'm going to stop here and apologize to everyone.

Last edited by LawnmowerMan; 07/28/14 08:53.
Re: Moving camera betwen two vector [Re: LawnmowerMan] #443938
07/28/14 09:04
07/28/14 09:04
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Originally Posted By: LawnmowerMan
@Kartoffel
Quote:
God, just stop all this bullshit, it's getting ludicrous

Man you're totally right. I'm going to stop here and apologize to everyone.

I actually didn't say this to you but to everybody (in case you think that).
If you still have questions please ask.


POTATO-MAN saves the day! - Random
Re: Moving camera betwen two vector [Re: Kartoffel] #443942
07/28/14 10:00
07/28/14 10:00
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Yes sure Kartoffel, I know you mean on all of us wink. And thank you for the code.
Yesterday, I had already made the camera moves in a given plane. To be honest I do not quite understand this formula, but I have an idea to make my own formula that will only slowly reduce the speed when camera is close to the target (if(vec_dist(camera.x,entityEND.x)<50) then camera_speed - slowdown formula). To make this formula I will try use vec_diff.
If that does not work I'll be back with new questions about formula for camera slowdown, but first I'll try to do it alone.

Re: Moving camera betwen two vector [Re: Kartoffel] #443943
07/28/14 10:11
07/28/14 10:11
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Weeeeee...

I love how I haven't personally attacked anyone but it seems to be all cool for you guys to do that. Don't want to imagine the shit storm if I did that.

Originally Posted By: LawnmowerMan
That's not a way how you and Sid can talk with me or anyone else. I just ask HOW and this is reason why this forum exist.

I told you how. The answer is math, plain and simple. "OH MERR GOD; YOU ARE SO TROLLING"... Sod off, the answer is math and no amount of sugar coating is going to change that. I even gave you a working algorithm that does exactly 100% what you want. But yeah, I'm so so mean and such a troll and so sarcastic and arrogant.

All you guys did so far was cry about how mean I am and how terrible of a person I am and how others with real answers should answer (let's ignore that that would exclude you from answering), totally ignoring the fact that I gave the correct answer including a working example two posts in. Hooray and go fuck yourself, Mr. Sid, am I right?

I'm sorry that somehow it's expected to spoon feed people and if that's not happen you are suddenly a bad guy. The quality of this forum will become oh so much better if we encourage people to not think for themselves anymore. Like, what the shit guys?! I'll give you that I made a snarky reply, not that it was factually wrong, but it was snarky. Sponsored by the attitude of Mr. LawnmowerMan and everything. I made my point why I answered this way and why I refuse to spoon feed people. If you guys get off of doing that, by all means, go ahead and answer. But seriously, whom is helped by you personally attacking me?

Again, vec_lerp() is partially an answer, but it's not the magic function he is looking for. He specifically asked for acceleration and deceleration, vec_lerp does linear interpolation. God I'm so evil for pointing that out, am I rite guyz?!

I got a good chuckle out of this thread, I'll give you that. The Mr. Sid part is funny, and thanks to 3run for the new nickname grin
But what I really love is this part:

Quote:
First answer from Mr. Sid is "math", yeah very useful. Second is formula for acceleration for which I had no idea where to use it. Like i say "Hey man, I am not smart like you". I use 3dgs as a hobby because I'm not a programmer and it seems to easiest engine for me. Your help I will not comment. You're here five years longer than me, and I'll bet you have no idea how to make this for what i ask.

Sorry, you are right. I have no idea to do what you asked for. My obviously wrong answer reflects that fact. I told you, I can barely add numbers togethers! Also, after punching in some numbers into a calculator, I arrived at the conclusion that I'm here three years longer than you, not five. I see why math was not the answer of your liking.

Go play in your bubble some more, it seems to be a fun place.


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] #443945
07/28/14 10:31
07/28/14 10:31
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Wait, wait. First of all you and DLivley mixing things. I tell him this about 'he have no idea how to make this for what I ask', and I tell you 'if you bored start make some game with A8'. First part of my text is for him and second for you. You just write, you must read also.

I think You've now realized that your first answer was so arrogant. Math, yes, every moment of our life is mathematics, but I ask for engine function also, I did not search a stupid answer you give me, or you simply can not understand this?
Anyway, are you at all the 3DGS user, or you just trolling around here?

Re: Moving camera betwen two vector [Re: LawnmowerMan] #443947
07/28/14 11:15
07/28/14 11:15
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Dear god, what is going on here. Look I agree that Sidney, the love of my life, is kind of rude sometimes; but you don't have to take it as a personal offense.

And quite besides that, he is absolutely right. Just asking for a solution won't get you ANYWHERE in game development or just development in general. You need to understand the underlying stuff, the way you come to a certain solution and the solution itself. It does you absolutely no good to just know the correct solution to THIS ONE PARTICULAR problem, it won't help you understand why it is the right solution. You need to understand the reasoning behind it as well, so that in the future you can apply that knowledge to problems that are similar.

The point you are making about the right engine function is completely irrelevant. I have been saying it since I started with 3DGS and I will keep saying it now: The Manual is your best friend.

Seriously, the 3DGS manual is one of the best manuals for game engines out there! Not only is it logically structured, easy to search and documents every function, their speed and more; No, it even explains how stuff works behind the scenes.

If you don't know that you need the "vec_lerp" function you'd do a full text search for "interpolation" and it would come up in the first results. Nobody needs to tell you that, this is a basic computer skill.

99.99% of all 3DGS problems can be solved by typing the main keyword about the problem into the manual search function and going through the top 10 results. Yes, I am sorry, you need to read and you need to possess reading comprehension skills.

This is not about being rude or not understanding newcomers, this is about applying basic, common knowledge, everyday skills to a problem!

You need to understand the underlying process of computer science problem solving, in the real world there is no such thing as "full code answer plox", YOU need to be the one to identify your problem, to understand what steps you need to take, apply a theoretical solution to your problem and if that didn't work, develop a new theory to solve the problem.

I understand that what we tell you here seems rude, because we don't just give you the complete answer, but in the long run you will need to learn how to solve this stuff on your own. What we can provide are pointers (Math!) and then come up with your own solution. If you are at the end of your rope, post the attempts that you made and explain why you came to such a conclusion and ask for a pointer in the direction of the right answer, you need to put in your own work in order for us to see that you are willing to work on a problem and to solve it on your own instead of relying on others to give you a solution on a golden platter.

Take your opening problem as an example, these are the steps that I would take to come to the same solution:

1. Identify your problem "I want to accellerate and decellerate camera movements between two points"
2. break down the complex problem into smaller bits:
- 1. Camera position = a Vector
- 2. Movement = a point between two vectors (start, end)
- 3. Accelleration/Decelleration = increasing and decreasing numbers

3. Find a solution to your main problem point (2.2) "How do I get a point between two vectors"
4. Alright great, now how do I get a point between two vectors at a specified distance?
- Keyword: Interpolation (You can get here by doing some basic google searches)
5. Now we know that you need to interpolate the camera position between your start and end point
- Look in manual for keyword "interpolation" or "interpolate"
6. Cool "vec_lerp"!
7. Now on to problem 2.3
- Accelleration and decelleration, keywords into manual
8. Find function
9. Now you have the basic building stones to propose a solution to your problem, so try it out.
10. Does it work? No? Go back a few steps and read through the way the answers you found work. Try again.
11. No luck even after repeatedly trying? Post a question here, and show us what approaches you have taken, let us see your thought process.

Then and only then can we help you get better. We can tell you where you went wrong and why, ask you why you would come to such a conclusion and give you an answer why that does and doesn't work and why something different would be better.

I am sorry that programming is not child's play, but there it is. There is a reason it's called "Computer Science" and not "Computer lego building".

Does this make sense to you?


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Moving camera betwen two vector [Re: LawnmowerMan] #443948
07/28/14 11:16
07/28/14 11:16
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: LawnmowerMan
Wait, wait. First of all you and DLivley mixing things. I tell him this about 'he have no idea how to make this for what I ask', and I tell you 'if you bored start make some game with A8'. First part of my text is for him and second for you.

Ah, right, gotcha. Sorry, that wasn't clear.

Originally Posted By: LawnmowerMan
I think You've now realized that your first answer was so arrogant.

I said snarky, not arrogant. Really, there is a difference. I don't hate answering questions, I don't mind giving lengthy explanations. It all really depends on the effort you put into your question, and I don't mind to elaborate on answers when things aren't clear.

Originally Posted By: LawnmowerMan
Math, yes, every moment of our life is mathematic

Oh come on, this is pathetic now. Next thing you tell me that we are all going to die and what's the purpose of anything, really?

Originally Posted By: LawnmowerMan
but I ask for engine function also, I did not search a stupid answer you give me, or you simply can not understand this?

This right there is the problem. You get the right answer and instead of even attempting to follow it or asking a follow up question, all you say is "oh, nice, but I really want finished code so kindly go fuck yourself" (Paraphrased, obviously, before anyone wants to whine about it).

Originally Posted By: LawnmowerMan
Anyway, are you at all the 3DGS user, or you just trolling around here?

Pack it up boys, this is a 3dgs users exclusive forum now. In all seriousness, this forum is going to be really empty if the non 3dgs users were no longer here.
And it turns out that concepts in programming transfer between languages and frameworks. I know right, terrible thing to think about.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Moving camera betwen two vector [Re: Kartoffel] #443949
07/28/14 11:40
07/28/14 11:40
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
Originally Posted By: LawnmowerMan
Yes sure Kartoffel, I know you mean on all of us wink. And thank you for the code.
Yesterday, I had already made the camera moves in a given plane. To be honest I do not quite understand this formula, but I have an idea to make my own formula that will only slowly reduce the speed when camera is close to the target (if(vec_dist(camera.x,entityEND.x)<50) then camera_speed - slowdown formula). To make this formula I will try use vec_diff.
If that does not work I'll be back with new questions about formula for camera slowdown, but first I'll try to do it alone.


To get back to helping you, since this is the first time you actually proposed a snippet of your own with some sort of explanation towards the reasoning behind it:

Don't user predetermined trigger points to de-/accellerate. As we keep telling you, the answer is math. Have you learned about sinus and cosinus? Alright maybe not, but you know what a sinus curve is, yes? (In case you do not, here is a visual helper: http://3.bp.blogspot.com/-SQ_Q9OZMM1E/T-K7S0u6McI/AAAAAAAAF00/6VhU0XLwWfA/s1600/sine-curve.png )

Now do you think that in order to get a curve as such, the mathematician goes "okay now I increased by 0.1 so I need to move this over 0.1" and then does that for every point? No, of course not, if he did that the curve would neither be smooth nor would he be able to accomplish it in his lifetime.

so "the answer is math", you only need one formula which will take care of all of this, you don't need certain points at which it will do the accelleration or decelleration, math with solve this problem mathemagically (harhar).

Let's have a look at what kartoffel showed you:

Originally Posted By: Kartoffel

Here's the damn code (I dind't test it), make sure you understand it.
Code:
float p = ...; // blending percentage, range [0...1]


p = 0.5 - cos(p * 3.141592) / 2.0; // apply smooth falloff
vec_lerp(vPos_Output, vPos_Start, vPos_End, p);



You have "p", which is a percentage (as the comment indicates), only that for computers "0-100" is a bit overkill, so we use 0.0 (0%) to 1.0 (100%), you can call this a factor if you wish to do so (and quite honestly I don't know the real name for this off the top of my head, but that is not important). To make it clearer: 5% would be 0.05 and 10% are 0.1. Easy so far, yes?

You have got two points, start and end (in Kartoffel's example "vPos_Start" (vector Position start) and "vPos_End" (go on take a guess what this stands for)) and you need a vector in which the new camera position is saved (vPos_Output).

In this example, p is the percentage of how "complete" the camera is through the path, at 0% the camera is at the starting position and at 100% it's at the end position, at 50% it's exactly between those two points.

Additionally you have this wonderful mathemagic line of "p = 0.5 - cos(p * 3.141592) / 2.0;" You can find these formulae online, you don't _really_ need to understand them, but it helps if you do. The gist is, that this will take care of accelleration and decelleration for you, no matter how long the distance between the two points is. You should read into it though, it will help you in the future, sin and cos are very important for "smoothing" stuff.

Now, I don't know how much of this you understand since you don't show any willingness to try something on your own and would rather wait for someone to spoon feed you the answer, or even how much you understand after I explained the general idea to you for the same reason as before. If you had done your research you could have come to a solution akin to

Code:
float p = ...; // blending percentage, range [0...1]
vec_lerp(vPos_Output, vPos_Start, vPos_End, p);



and you would understand HOW it works and why! But you would want it to be better, like what you wanted but your math sucks, so you could have posted that and asked if someone knows a simple formula that will help you accomplish this and we would have given it to you, because we have seen that you have tried yourself and that you have put work into it and that you have grasped that basics. that the only thing lacking was your understanding of higher mathematics, which is fine! Not everyone can be an Albert Einstein, but it would have shown initiative on your part, which is all we are asking for.


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Page 3 of 5 1 2 3 4 5

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1