Moving a node based on rotation
-
Ameise
Moving a node based on rotation
Ok, so, I have a node (a camera), and I can rotate it. However, I want it, so when I apply THRUST (stored in variable speed) it will move in the direction of it's rotation. To make it more complex, the speed of it's movement should be based on SPEED. Every integer (IE, speed = 1) is one unit / second.
Any ideas?
Any ideas?
Re: Moving a node based on rotation
read this thread http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=843Ameise wrote:Ok, so, I have a node (a camera), and I can rotate it. However, I want it, so when I apply THRUST (stored in variable speed) it will move in the direction of it's rotation. To make it more complex, the speed of it's movement should be based on SPEED. Every integer (IE, speed = 1) is one unit / second.
Any ideas?
-
Guest
Aye, I adapted that and it works, however, I have a new problem.
I modified the FPS camera to technically allow you to move the camera beyond x = 90, -90, but it has a problem. If I go to either of those, the camera flips, then starts going back around. It is really wierd.
Also, you quit by pressing q, but it forces a hard crash.
http://www.kuattech.com/project.rar
my source is also in there, plus the FPS cam source with my mods.
BTW, I can't rotate the camera on the Z axis either?
I modified the FPS camera to technically allow you to move the camera beyond x = 90, -90, but it has a problem. If I go to either of those, the camera flips, then starts going back around. It is really wierd.
Also, you quit by pressing q, but it forces a hard crash.
http://www.kuattech.com/project.rar
my source is also in there, plus the FPS cam source with my mods.
BTW, I can't rotate the camera on the Z axis either?
succes!
SUCCES!!!!! hahaha, it worked for me, I created a cam that does not flip, here is the link:
http://www.freewebs.com/therealsoundofm ... acecam.zip(do not pay attention to the website itself, its for my school.) it is the source of my current project, where you can play a split screen game, it works with a usb/ps2 mouse and a serial one(connect the serial one when windows has booted) No debugging/cleaning done whatsoever, use it just for the 'spacecamera' code.
Maybe someone can tell me in return how I can make the testbox rotate, so the 'front' is always in the direction of the target(but I do not like sin/cos, there should be a way without using them) Its going to be a head that floates in space
Greets Robin
http://www.freewebs.com/therealsoundofm ... acecam.zip(do not pay attention to the website itself, its for my school.) it is the source of my current project, where you can play a split screen game, it works with a usb/ps2 mouse and a serial one(connect the serial one when windows has booted) No debugging/cleaning done whatsoever, use it just for the 'spacecamera' code.
Maybe someone can tell me in return how I can make the testbox rotate, so the 'front' is always in the direction of the target(but I do not like sin/cos, there should be a way without using them) Its going to be a head that floates in space
Greets Robin
-
Ameise
yeah, I just noticed too that my site is sloooow, srry about that(if you know a better site, just tell me, ill upload it to there), but it does not do that precise movement, you can implement it verry easely though, just add a global var or someting, that you use instead of the delta mouse x,y Then with some simple if()'s you should be able to make it move like you want. Just tell me if you cannot get it to work, cause I think I could do it for you in an hour max(but where's the fun in that?)
much luck with your project
greets Robin
much luck with your project
greets Robin
Re: succes!
how can you not like sin/cos? they are fundamental to understanding the world we live in!Phunk wrote:Maybe someone can tell me in return how I can make the testbox rotate, so the 'front' is always in the direction of the target(but I do not like sin/cos, there should be a way without using them)
-
Guest
-
Ameise
well, I DID include the full source, (I just have one cpp file, because I just used example 2 as reference,
and if you look at the includes, you see that its 3 files: windows.h, stdio.h and irrlicht.h, and the first two just come with visual C++)
I did NOT changed the dll!!!!
And I just gave you the source, THAT explaines how the cam works.(and it works!) it is not my fault YOU cant understand it(and compile it, its written in visual c++),
just use it or dont, if you just look at the animateFPSCam function(and you understand C++), you should be able to understand what I'm doing, and if you do, you can recreate it in several minutes
I dont need this poop, I try to help you, and jou don't even try to work something out yourself, you just complain. what did you think? that the solution is carried to you on a platter? well I'm not helping anymore, do it yourself(and really you should be able to, I just tried for weeks to get it to work, but Im a novice programmer) just dont tell me I did something wrong, when you are just too lazy to try to do it yourself
and if you look at the includes, you see that its 3 files: windows.h, stdio.h and irrlicht.h, and the first two just come with visual C++)
I did NOT changed the dll!!!!
And I just gave you the source, THAT explaines how the cam works.(and it works!) it is not my fault YOU cant understand it(and compile it, its written in visual c++),
just use it or dont, if you just look at the animateFPSCam function(and you understand C++), you should be able to understand what I'm doing, and if you do, you can recreate it in several minutes
I dont need this poop, I try to help you, and jou don't even try to work something out yourself, you just complain. what did you think? that the solution is carried to you on a platter? well I'm not helping anymore, do it yourself(and really you should be able to, I just tried for weeks to get it to work, but Im a novice programmer) just dont tell me I did something wrong, when you are just too lazy to try to do it yourself
well dunnow about the implementing of the code(wrote it in visual C++) but its just the animateFPScam function that is interesting(it is the original source of the prog that I'm working on, so ignore the rest:split-screen, serial mouse), its not a class or anything.(i will do that later, but for now ill use this) and this function is verry similar to the FPScam in the irrlicht source(just adapted it for my cams, controlled by separate mouses) look after '// set target ' here is where the stuff takes place.I can find no easy way to implement your code into mine... and why do you need a mouse driver?
-
Ameise
I would have prefered an explanation to why it worked rather then source code w/ no explanation.
Also, any time I try to port your camera code, I get a variety of errors that make no sense to me. For instance, what is
core::vector3df target = oldtarget[player-1];
core::vector3df upvec = oldupv[player-1];
core::vector3df lvec = oldlvec[player-1];
?
Also, any time I try to port your camera code, I get a variety of errors that make no sense to me. For instance, what is
core::vector3df target = oldtarget[player-1];
core::vector3df upvec = oldupv[player-1];
core::vector3df lvec = oldlvec[player-1];
?
-
Ameise