HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How to: fix disapearing models on the edge of the screen

01-20-2007, 09:27 PM#1
olofmoleman
How to: fix disapearing models on the edge of the screen

Introduction

In this tutorial I will tell you how to fix models that disapear when they come too near the edge of the screen, a lot of models that are either very big or are long or tall can have this problem.
For this tutorial I'll use my Orthanc model as example because it's a good example of a model that is so tall that it disapears when it comes too near the edge of the screen.
I will explain how to fix this problem both in mdl editing and in Magos' model editor
Click image for larger version

Name:	DisapearTut01.jpg
Views:	229
Size:	25.0 KB
ID:	19541

Tools needed

For editing: Notepad or Magos' model editor
For finding coordinates: Vertex Modifier
For model viewing: Magos' model editor or Wc3 Viewer
For converting: YobGuls' file converter

Getting started

If you want to edit the model in mdl code you'll need to convert the model to .mdl format if it's still .mdx and if you want to edit the model in Magos' it doesn't matter if the file is .mdx or .mdl, so it's easiest to just use .mdl

Once the file is .mdl format we can begin.
To fix the problem you have to edit the Minimum and Mazimum extent of the model. In Magos' model editor you can find it by clicking on "Edit, Model Properties" Then you'll see this window
Click image for larger version

Name:	DisapearTut02.gif
Views:	123
Size:	9.4 KB
ID:	19542
Here you'll see the coordinates of the Minimum and Maximum extents.

If you are editing in .mdl you need to find this portion near the bottom of the code

Code:
	}
	MinimumExtent { -86.1265, -82.6042, -1.52796 },
	MaximumExtent { 81.0091, 78.4363, 143.519 },
	BoundsRadius 113.928,
	MaterialID 0,
	SelectionGroup 0,
}
Just like in Magos' Model Editor you can see the coordinates of the extents, the first coordinate is the X axis, the second the Y axis and the last one is Z

The X axis is from front to back
The Y axis is from left to right
And the Z axis is from top to bottom
But, 0 is the center of the model, so for example; 10 would be above the center of the model, but -10 would be below, this aplies to all axis'

But before you modify the coordinates of the extents, you need to know to wich number you have to change it.

This is where Vertex modifier comes in.
Open the .mdl file in Vertex Modifier
Click image for larger version

Name:	DisapearTut03.gif
Views:	263
Size:	24.4 KB
ID:	19543
On the picture you can see my Orthanc model loaded in Vertex Modifier, if you look at the coordinates (at the bottom of the picture), it says it's about 600 at the top of the tower. Now roughly know the coordinates we can go back to Magos' Model Editor or .mdl code
So, the height of the tower was about 600, but to be sure I'm gonna increase the number a little bit further to be sure the model doesn't disapear anymore, so I changed Z axis Maximum Extent to 615.
Not only do I have to change the height Extent coordinates, but also the horizontal coordinates, my Orthanc model is mostly symmetrical at the base, so the coordinates for both X and Y axis should be the same here.
In the picture and code below you can see the height coordinates I changed first, and the other coordinates
Click image for larger version

Name:	DisapearTut04.gif
Views:	104
Size:	9.2 KB
ID:	19544
Code:
	}
	MinimumExtent { -85, -85, -1.52796 },
	MaximumExtent { 85, 85, 615 },
	BoundsRadius 113.928,
	MaterialID 0,
	SelectionGroup 0,
}

And now the problem should be fixed.
Now all you need to do is convert the model back to .mdx and import it in a map and see if you got the coordinates correct.
Attached Images
File type: jpgDisapearTut01.jpg (25.0 KB)
File type: gifDisapearTut02.gif (9.4 KB)
File type: gifDisapearTut03.gif (24.4 KB)
File type: gifDisapearTut04.gif (9.2 KB)
01-21-2007, 09:57 AM#2
SeruK
Excellent, exactly what I needed. :] Good job.
01-21-2007, 12:12 PM#3
Archian
Quite useful tutorial ^^
Just to be a little sceptical; it seems like your tutorial lacks a bit of intervals between the lines

-- Good job nonetheless
01-22-2007, 01:38 PM#4
PitzerMike
Cool, approveloled.
01-25-2007, 03:10 PM#5
Nasrudin
Err... this is actually all you need to fix that issue. There is NO need to convert the format, NO need to find the extents, and NO need to fix them manually. Magos' editor do it in 5 seconds; it also fix the bound radius by default.
Zoom (requires log in)
01-26-2007, 11:56 AM#6
Xaran Alamas
Well thanks to both olof and Nasrudin. I've often had problems with models dissappearing :)
01-28-2007, 05:51 PM#7
olofmoleman
Quote:
Originally Posted by Nasrudin
Err... this is actually all you need to fix that issue. There is NO need to convert the format, NO need to find the extents, and NO need to fix them manually. Magos' editor do it in 5 seconds; it also fix the bound radius by default.
Zoom (requires log in)
lol, though my tutorial could still be useful if you wanted to fix it in mdl.
Attached Images
File type: jpgext.jpg (33.7 KB)
01-31-2007, 04:12 PM#8
Callahan
Does this affect doodads with large scaling value modified with WE object editor?
02-07-2007, 10:33 AM#9
olofmoleman
Yes, it should
05-02-2007, 07:00 PM#10
Pyritie
Yay no more disappearing trees or units! Thanks olof, and Nasrudin (I always wondered what that button did...)