RTS Camera
I'm using Vista (don't say it, I know) with Code Blocks. If I comment the line out it works but it is very difficult to find a mesh in the scene. Edge scrolling is waaaaaay to fast. Any way to slow that down without slowing anything else down? I would also like to know how I might change the rotation pivot for the camera for example: to rotate the camera around a selected unit. This might help minimize distortion that I get from the generalized rotation.
yes, I don't know why, but you'll have to change this line(s) to:Jumach wrote:I added the rtscamera.cpp to my project but when I compile my main.cpp I get an error on line 134:
if ( core::equals ( fabs ( dp ), 1.f ) )
No idea why I can't get this to work...
Code: Select all
f32 dp = fabs(tgtv.dotProduct(up));
if ( core::equals ( dp, 1.f ) )
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 219
- Joined: Fri Feb 19, 2010 4:03 pm
- Location: Estonia
Now that's strange.. if you comment outJumach wrote:If I comment the line out it works
Code: Select all
RTSCamera* camera = new RTSCamera(device,smgr->getRootSceneNode(),smgr,-1,100.0f,10.0f,10.0f);
Are you sure you're not creating two cameras? In any case, if you post your main.cpp I could try to look through it and help.
to live, is natural; to die, is not!
I commented out the line that Acki mentioned. Everything seems to work fine except that I cannot figure out how to change the start position of the camera or the starting target. All I have in my scene is a small square landscape similar to the ones in Final Fantasy Tactics. I want to know how I can get the RTS camera to start from a nice 45 degree isometric view. Of course I don't it fixed here so no using default cameras.
BTW now that I got this camera working (I think it's working properly) I'm really loving it. Excellent work.
BTW now that I got this camera working (I think it's working properly) I'm really loving it. Excellent work.
you should not comment them out, but change them like I described...Jumach wrote:I commented out the line that Acki mentioned.
you can't do that at creation, instead use setPosition and setTarget afterwards...Jumach wrote:Everything seems to work fine except that I cannot figure out how to change the start position of the camera or the starting target.
or you change the constructor so it takes a position and target vector and set it to the node inside the constructor...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Thanks! That should have been obvious, right? Well that's why I'm here. That worked wonders, now I need to figure out why the perspective feels so distorted... When I rotate the camera in-game, my mesh appears to be turning on its side. Would setting max and min values for rotation and translation help solve this?
Also when I change those lines, the program terminates immediately upon execution. I don't know why but commenting that one line out makes it work...
Also when I change those lines, the program terminates immediately upon execution. I don't know why but commenting that one line out makes it work...
Sorry to double post but now the program is completely broken. Whenever I press compile and run in Code Blocks it tells me the program needs to be built and asks me If I want to do this now. It never used to ask me that before. Even if I revert to the way it was I'm still getting the same problem and the program just closes instantly. Here's what is tells me:
Linking console executable: bin\Debug\test.exe
/mingw/lib/libstdc++.a: file not recognized: Not enough space
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
Linking console executable: bin\Debug\test.exe
/mingw/lib/libstdc++.a: file not recognized: Not enough space
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
for me it works when changing the lines (I'm also using C::B)...Jumach wrote:Also when I change those lines, the program terminates immediately upon execution. I don't know why but commenting that one line out makes it work...
huh, I never saw this error until now...Jumach wrote:/mingw/lib/libstdc++.a: file not recognized: Not enough space
but it sounds like your hard drive is full !?!?!
Last edited by Acki on Thu Mar 18, 2010 11:41 pm, edited 1 time in total.
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Hard drive has 260gb of free space. This is some serious BS because it was working until, literally, 10 minutes ago. I made the suggested changes to my code. When that failed I reverted to an older save that didn't have the change. I cannot stress enough that NOTHING in this file is any different than it was when it worked. Now Code Blocks is telling me that "The file needs to be built. Would you like to build it now?" Of course I do! That's why I clicked F9 (Build and Run)!!! Even after a restart it will not work...
UPDATE: Re-Install doesn't help.
UPDATE: Re-Install doesn't help.
-
- Posts: 1
- Joined: Fri Jun 18, 2010 11:11 am
Hi,
The code on the first page works (except collision detection but tha'ts not so important for me) but now if i try to add user interface elements it doesn't work.
Is there an other way to do this?
EDIT:
Just copy & paste without having a closer look wasn't a good idea. if there is no env->drawAll(); it can't work.
The code on the first page works (except collision detection but tha'ts not so important for me) but now if i try to add user interface elements it doesn't work.
Code: Select all
env->addStaticText(L"This is a Text", rect<s32>(50,110,250,130), true);
EDIT:
Just copy & paste without having a closer look wasn't a good idea. if there is no env->drawAll(); it can't work.
Well, english is not my main language but i will try to express!
I have used this RTS camera with the modifications provided by xirmatrix(sorry if i miswrited it), but i found one odd thing, that is if you rotate one object by 180 degrees around the xaxis, when you press A the object will rotate around Z by 180 degrees!
I'm starting now at irrlicht but i do understand very well the equations that must be behind it (as physicist)! If anyone can help me or point me some tutorials on how irrlicht does the projections transforms, it will be mutch apreciated!!!
Regards rayden!
I have used this RTS camera with the modifications provided by xirmatrix(sorry if i miswrited it), but i found one odd thing, that is if you rotate one object by 180 degrees around the xaxis, when you press A the object will rotate around Z by 180 degrees!
I'm starting now at irrlicht but i do understand very well the equations that must be behind it (as physicist)! If anyone can help me or point me some tutorials on how irrlicht does the projections transforms, it will be mutch apreciated!!!
Regards rayden!
how to realize a orthogonal projection with RTS camera
The code in the first page runs well, but it seems as a perspective projection. how to use RTSCamera with Orthogonal projection? A common fixed camera with orthogonal projection uses the follow few lines
//matrix4 orthoMatrix;
//ICameraSceneNode * camera = smgr->addCameraSceneNode();
//orthoMatrix.buildProjectionMatrixOrthoLH(700, 130, -10, 1024);
//camera->setProjectionMatrix(orthoMatrix,true);
//matrix4 orthoMatrix;
//ICameraSceneNode * camera = smgr->addCameraSceneNode();
//orthoMatrix.buildProjectionMatrixOrthoLH(700, 130, -10, 1024);
//camera->setProjectionMatrix(orthoMatrix,true);