So as a resume on my FPS game, I belive that I don’t need animations for aiming down the sight, or possible shooting. This allows me to customize it for each weapon so I don’t have to make animations for this because they are all pretty much the same. As you see in the jme3 beta game Lexicon, I want the gun to smoothly move to the enter of the camera, towards the camera, and up. How can I smoothly change to location to this? Making this transition in code will allow me to make adjustments depending on sights, speed of transition, all based on the gun model. I have seen this done in Lexicon, so I know it is possible, I just don’t know how. @wezrule @normen @zarch
Please don’t tag random people into a thread unless you have a specific question for one person.
Asshole
Well thanks for your guys help. Honestly, can someone please help me with this?
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_node
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:beginner:hello_main_event_loop
http://www.jmonkeyengine.com/doc/com/jme/math/Vector3f.html#interpolate(com.jme.math.Vector3f, float)
Thanks @zarch I appreciate it. So I use the vector interpolate method and put in the destination vector, but I am confused about the math part that determine the change amount. It says like this=(1-change amount)*speed and such. Could you write the line that would interpolate an object to let’s say 2,2,2 please?
I have tried node.move(vector3f.interpolate(0,10,0),.01f) but it constantly moves and I tried node.setlocaltranslation(same as above) and it does nothing. And I am doing all this under the update method. How am I supposed to get this working? @zarch
You need to stop specifically tagging people. Just don’t do it. If you think to start doing it again then just don’t.
The people who will answer will still read it.
Do all of the tutorials. All of them. Then read the math for dummies and scene graph for dummies help links on the main forum page. You are starting from ground zero on game programming so it pays do so some of your own legwork and learning.
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math_for_dummies
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies
@pspeed I am definately not starting from ground zero. I have years of programming experience but I decided to play around with 3d stuff. 3d programming is the only thing new to me.
@jrlowe said:I am definately not starting from ground zero. I have years of programming experience but I decided to play around with 3d stuff. 3d programming is the only thing new to me.
Thats what he said and he also said what you can do about changing that. But I guess you seriously want to piss off everybody who could help you, so have fun applying your years of experience to reading the documentation.
@jrlowe said: @pspeed I am definately not starting from ground zero. I have years of programming experience but I decided to play around with 3d stuff. 3d programming is the only thing new to me.
Yeah… the thumbs down for being helpful won’t fly long either.
“Definitely not starting from ground zero but totally new to 3D game programming.” Maybe we have a different definition of “starting from ground zero”.
Good luck with your learning. I’m probably not responding again.
Well if any of you could give me some code to understand and play around with other than throwing links around, trust me I have read all these, I just don’t know how to apply it in the way I want to use it in my game. I read the math for dummies and everything but I need your guy’s help to apply it in the way that I am trying to. I am not trying to make you guys mad, but everytime I have asked about this thread topic, I get ALL the same links and I have read them, I jest need help apply the concepts to the way I want to use them. I just get frustrated because posting the same links isn’t helping me out much anymore. :amused:
@jrlowe said: Well if any of you could give me some code to understand and play around with other than throwing links around, trust me I have read all these, I just don't know how to apply it in the way I want to use it in my game. I read the math for dummies and everything but I need your guy's help to apply it in the way that I am trying to. I am not trying to make you guys mad, but everytime I have asked about this thread topic, I get ALL the same links and I have read them, I jest need help apply the concepts to the way I want to use them. I just get frustrated because posting the same links isn't helping me out much anymore. :amused:
Lol, did you seriously thumb down the only person in this thread that still somehow wants to help you? You are really serious about the pissing off people thing ^^
I don’t understand why You guys had to start blowing up at me when I tagged 3 of you in the question. I thought that you three would be the most helpful, you are welcome. Did I mean to bother you guys? No. Did I intend for you guys to flip out at me? No.
How can I delete this thread…I’m having a feeling that helpful lines of code aren’t coming…
@jrlowe said: Thanks @zarch I appreciate it. So I use the vector interpolate method and put in the destination vector, but I am confused about the math part that determine the change amount. It says like this=(1-change amount)*speed and such. Could you write the line that would interpolate an object to let's say 2,2,2 please?
Can you explain what isn’t clear about this?
See, we have kind of a communication problem. You’ve asked the 3D programming equivalent of “how do I print a different string in my hello, world program” and we said “pass a different string” and now we are all trying to sort out why that wasn’t enough.
interpolate() interpolates (no coincidence) between one value and another. At 0 it’s the first value at 1 its the other value. Anywhere in between it’s the interpolated (again no coincidence) position between those two.
One confusing part might be move(). http://hub.jmonkeyengine.org/javadoc/com/jme3/scene/Spatial.html#move(com.jme3.math.Vector3f)
Which says: “Translates the spatial by the given translation vector.”
Now, to a graphics guy this is 100% clear because “translating” is moving something from its current position. So it’s relative and not what you want.
We can’t see the code you posted to use setLocalTranslation() so we can’t tell you what’s wrong with it. I can probably guess it’s one of two or three things but you’d save us a lot of speculation and wild goose chases if you’d just show us. Even the little code mentioned in that particular post is pseudo code because the interpolate() isn’t right. My guess is that you were passing the same change amount every time.
If you pass a constant as your “change amount” then you are going to get the same interpolated value every time.
“changeAmnt - An amount between 0.0 - 1.0 representing a precentage change from this towards finalVec”
For example, 0.5 will give you the same percentage every time… ie: the same interpolated value.
If at time A you want your spatial to be at one place and at time B you want it to be in another then the change amount is (time - A / (B - A)).
But if this the math that is tripping up it only gets exponentially harder from here. I suggest buying a beginning game programmers book and running through it. These are not JME questions, they are ground-zero game programming questions… and this one isn’t even 3D specific.
@jrlowe said: I don't understand why You guys had to start blowing up at me when I tagged 3 of you in the question. I thought that you three would be the most helpful, you are welcome. Did I mean to bother you guys? No. Did I intend for you guys to flip out at me? No.
They asked you to stop and then you immediately did it again. Those of us who take the time out to help others already read all of the posts. You do not need to fill up our mentions list with garbage.