Sammie Posted July 20, 2010 Report Share Posted July 20, 2010 After compiling (with VS2010 + replacing with a newer boost-Version) I see the "binaries\system\pyrogenesis_dbg.exe"-file.No compiling errors. I can run it and play. But the Szenario-Editor is not available in the mainmenu. When I start the file with the "-editor"-Parameter a messagebox appears with the following message: "The Atlas UI was not successfully loaded and therefore cannot be started as requested. Location: Atlas.cpp:46 (ATLAS_Run)". Whats wrong? Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 20, 2010 Report Share Posted July 20, 2010 Atlas isn't compiled by default on Windows, since the wxWidgets dependency is a bit of a pain. See libraries/wxwidgets/README.txt and download and compile wx, then run "update-workspaces.bat --atlas" and build.(If you just want to run the editor and not necessarily compile it, you can either use the precompiled pyrogenesis.exe in SVN (which uses AtlasUI.dll), or manually copy AtlasUI.dll to AtlasUI_dbg.dll so self-compiled Debug builds will find it, or wait for #456 (hopefully I'll have time to check it later today).) Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 20, 2010 Author Report Share Posted July 20, 2010 That works with wxWidgets, thx btw, is there a quick way to switch from a "perspective" camera to a fixed "isometric" camara in atlas?Or is it too complex to change this? Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 20, 2010 Report Share Posted July 20, 2010 Do you mean something like resetting the camera to its initial position, or changing it to an orthographic non-perspective camera? Neither is supported at the moment, though I guess they wouldn't be too hard to add. (source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp implements the interface between Atlas and the camera, and it could have more functions to provide more camera control. Orthographic views would probably need changes to CCamera to compute non-perspective matrices.) Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 20, 2010 Author Report Share Posted July 20, 2010 Yeah, I mean change it to an orthographic non-perspective camera.Hmm, sounds difficult for me. I don't really know what I have to do. Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 21, 2010 Author Report Share Posted July 21, 2010 Which functions should I modify to get an orthographic (non-perspective) camera?Only the ProjectionMatrix in CCamera::SetProjection (Source/graphics/Camera.cpp)?Or any other functions, too? Would be nice, if you can help me. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 21, 2010 Report Share Posted July 21, 2010 I think that's the case - it probably needs to implement a matrix like shown here (near the bottom). It's possible GetCameraPlanePoints needs to be updated too (it depends on FOV, which is meaningless with an orthographic camera). I'm afraid I don't know enough about graphics to know if this will really work, though. Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 22, 2010 Author Report Share Posted July 22, 2010 Hey Ykkrosh,I have tried to set the following code in CCamera::SetProjection.(I'm calculating the l,r,b,t values from the ViewPort-width/height) float w = m_ViewPort.m_Width; float h = m_ViewPort.m_Height; float r = w/2; float l = -r; float b = h/2; float t = -b; float n = nearp; float f = farp; // orthographic matrix m_ProjMat._11 = 1/r; m_ProjMat._22 = 1/t; m_ProjMat._33 = -2/(f-n); m_ProjMat._34 = -((f+n)/(f-n)); m_ProjMat._44 = 1.0f;and in CCamera::GetCameraPlanePoints float w = m_ViewPort.m_Width; float h = m_ViewPort.m_Height; float x = w/2; float y = h/2;but this doesn't work. I can't see the terrain. Any ideas whats wrong?Is someone else in your team, who can help me with this? It drives me crazy Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 22, 2010 Report Share Posted July 22, 2010 It looks like the camera's basically just pointing the wrong way. Also w and h are going to be measured in world-units (quarters of a tile), not pixels, so they ought to be smaller. Also need to call m_ProjMat.SetZero. This seems to work for me: float w = 64; float h = 64; float r = w/2; float b = h/2; float n = nearp; float f = farp; // orthographic matrix m_ProjMat.SetZero(); m_ProjMat._11 = 1/r; m_ProjMat._22 = 1/b; m_ProjMat._33 = 2/(f-n); m_ProjMat._34 = -((f+n)/(f-n)); m_ProjMat._44 = 1.0f; Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 22, 2010 Author Report Share Posted July 22, 2010 Ahhh, that works. Thank you! :) Quote Link to comment Share on other sites More sharing options...
Quassy Posted July 22, 2010 Report Share Posted July 22, 2010 So will there be an ingame button (not "hidden" in the options menu) to switch to isometric view in the final game? That'd be amazing Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 22, 2010 Author Report Share Posted July 22, 2010 So will there be an ingame button (not "hidden" in the options menu) to switch to isometric view in the final game? That'd be amazing A hotkey (F1-F12) would be a great idea. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 23, 2010 Report Share Posted July 23, 2010 It'll need changes to the camera controls before it'd work properly - keep the height constant and adjust the view size when zooming (instead of moving the camera's position), and then I think it might be okay. If someone implements the controls and the mode switching, I wouldn't object to adding it into the game in some form Quote Link to comment Share on other sites More sharing options...
Sammie Posted July 24, 2010 Author Report Share Posted July 24, 2010 It'll need changes to the camera controls before it'd work properly - keep the height constant and adjust the view size when zooming (instead of moving the camera's position), and then I think it might be okay. If someone implements the controls and the mode switching, I wouldn't object to adding it into the game in some form The camera controls are not the only problem. Its impossible the modify/flatten/paint the terrain in the orthographic view at the moment. I don't know why, but the cursor "sticks" on some tiles and I cannot really move it. Same thing for moving objects. Too many lines of sourcecode for me to figure out what I have to change to make it work. Any ideas? Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted July 24, 2010 Report Share Posted July 24, 2010 That probably comes from AtlasMessage::Position::GetWorldSpace calling CCamera::GetWorldCoordinates calling CCamera::BuildCameraRay. That tries to compute the 3D line that's underneath the mouse cursor, and it assumes the line is always starting at the camera's location and its direction is spreading outwards to hit a point on the far plane. With the orthographic camera, that's not right - it needs to compute a line which is always parallel to the camera direction, with the origin moved depending on the target point. I don't know exactly what maths is needed, but I think that's where the problem is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.