Archived

This topic is now archived and is closed to further replies.

paulcoz

VIS / FOV / Zoom in a level editor?

Recommended Posts

Hope you can help with these questions: VIS / FOV - Should a level editor include the same sort of visibility testing as a run-time 3D-engine (eg. discarding objects outside the FOV - outside the left, right, up, down planes)? The reason I ask is that you usually use orthogonal wireframe projections (left, behind, above) and you don't perform exactly the same visibility tests you normally would to determine whether objects are behind or ahead of the world-axis-aligned camera (you project everything), or whether objects are concealed by other objects (you see everything!). Zoom - Is the ability to zoom in a level editor, purely a result of increasing/decreasing the FOV by changing the projection screen distance from the camera? Do I decrease this screen distance to widen the field of view, or is Zoom a direct result of scaling the screen coordinates? If I have to scale the screen coordinates I will also have to adjust my drawing tools (eg. the ones where you click/select points on the screen) to account for this scaling, won't I? Perhaps I have to do both (widen the field of view & scale the screen coordinates)? Maybe I have to move the camera too?? Please assist!! Paulcoz. Edited by - paulcoz on January 28, 2001 12:33:13 AM

Share this post


Link to post
Share on other sites
VIS / FOV - You''ll definetly want to include some sort of depth testing algos in the editor, but in terms of visibility testing, not really. 3D engines use visibility testing purely for speed; not sending anything to the renderer that doesn''t need to be. In a map editor, speed isn''t really an issue. It''s a tool, and tools only need to be fast enough, not turbo speed. So basically stick with depth sort tests to draw the polygons in the right order, but in general, send everything to the renderer. Usually the user won''t be making maps so hard and complex that the renderer starts to choke and slow down. I recommend OGL for this 3D view, as it''s commonly called in the Map Editing world.

Zoom - Zoom? For the 2D views, yes (side, front, top), and you''ll need to adjust the drawing tools (like click/select) to compensate for the zoom. But in 3D, it''s not neccessary.

NOTE: If you do make a map editor, make sure to have the 4 essential views: Side, Front, Top, and 3D . Use WorldCraft as an example as a good editor (its great).

Share this post


Link to post
Share on other sites
Hi Zipster,

I was talking specifically about the 2D views.

You don't think I should have any VIS at all? I haven't tried a big map yet, but I anticipate that transforming the whole map, regardless of what is actually seen on the screen, will bring the editor to a crawl, just like it would in the run-time version of the game? I don't really want the editor to be sluggish once the map gets large.

Do you have anything to say about how the zoom is implemented? Am I on the right track with the projection screen / scaling? I really need some specifics about zoom - whether the FOV should be altered to zoom, how the FOV affects what can be seen etc..

Paulcoz.

Edited by - paulcoz on January 29, 2001 8:48:55 PM

Share this post


Link to post
Share on other sites
As for VIS in the 3D views, simply create an algorithm that tests to see if each line intersects the viewing rectangle or not. if it intersects, draw it, otherwise, don''t draw it. This is a simple line-to-rectangle collision detection.

As for zooming...this basically means adjusting the logical map coordinates. As long as the world coordinate system (i.e the moniter''s resolution) stays the same, it should naturally zoom for you. now this is assuming you''re making a Windows Application and are using.....well, what API are you using to create this editor? If you are using DX, you can even create the Application in MFC and add DX hooks here and there. You will then be able to attach DX to the views, and since you have the Windows API handy, you can easily scale the logical coordinate system. NOTE: When you do adjust the logical coordinate system, you will also have to compinsate for the mouse movement. Actually, there is a Windows function. CWnd::ScreenToClient() that will convert the mouses position in real-space the the actuall cordinate system of your map (view in other words). Now thats if you use MFC for the editor. It''s all up to you.

Hit me back with any additional questions. I know i might not have been too clear there; its late.

Share this post


Link to post
Share on other sites
Zipster - what do you mean by 'adjust the logical map coordinates' when zooming - do you mean the world coordinates? How should I adjust them - globally scale all of the coordinates so that everything in the map shrinks around the origin?

Thanks,
Paulcoz.

LATER
I tried this last night & I think it might actually be working - I even got the tools to function regardless of the zoom setting with a bit of tampering - good work Zipster

Edited by - paulcoz on January 30, 2001 5:31:36 PM

Share this post


Link to post
Share on other sites
No problem. Let me give of an example of what i meant. I''m sure you''ve used a graphing calculator before. Well, the even thought the calculator has a fixed number of pixels on the screen (relate this to the computers world coordinates; the resolution/moniter), you can change the window to scale the graph to zoom in. Thats bassicaly in effect what i meant in terms of scaling the logical coordinates.

Share this post


Link to post
Share on other sites
I my editor I implemented zoom by glViewport( ... ). It takes left, right, top and bottom as parameters. By making the numbers larger in their respective directions the virtual window becomes larger allowing more geometry to appear on the screen. Make the numbers smaller and less geometry appears. Zoom in a 2d environment. I don''t know what api you are using or if there is a better way but this works.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites