VitoPlantamura.com logo - Click here to go to the site home page... Click here to go to the site home page... Click here to go to the Blog page... Click here to go to the archives page... Click here to go to the about page...
"extremely impressive work"
- Mark Russinovich, www.sysinternals.com
(referring to my BugChecker)
my face...
Homepage of Vito Plantamura (@), Windows Researcher, VPC Technologies SRL CEO. [user=Guest] - updated: August 08, 2007
 MAPGEN SUITE OF TOOLS
MAPGEN TOOLS

MapGen is part of a set of three powerful and professional level development tools that allow to create game content for a three dimensional engine. The engine itself and/or parts of it cannot be presented here for copyright reasons. The tools can be considered fully working and implemented. The MapGen tools suite was developed by me (Vito Plantamura) in 1999.



     1: MapGen editor: the shot shows the advanced UI of the editor (scrollable toolbars and dialogs and editable Bezier patches).
     2: MapGen editor: the shot shows some advanced UI solutions developed for the editor (in the shot: a list box with controls and a code edit box with highlighted syntax).
     3: MapGen editor: the shot shows the advanced system of entity management and the HTML help (available in a WebBrowser ActiveX control directly inside the UI).
     4: Modeler editor: the shot shows the MDI environment of the editor (Modeler allows to import skinned characters and simple meshes with animation data into documents).
     5: Server Control plugin: the shot shows the plugin interface (the MSC plugin allows to export the current scene from 3DStudio Max into Modeler and to import shaders as materials from MapGen into MAX).

FEATURES

     Full written in C, C++ and 80x86 assembly with the aid of MFC for user interface programming.
     Brush-based CSG editor with support for biquadratic Bezier patches.
     Location transparency of each tools through extensive use of DCOM.
     Integrated environment for developing maps and writing scripts. MapGen allows to compile maps and scripts seamlessly in the same UI (strong multithreaded structure for simultaneous compilation operations).
     Patch editing with operations such as capping, thickening etc...
     OLE Automable to allow writing of addins, plugins etc... (full access to map primitives through the MapGen Object Model and support for classes for representing matrices, vectors, texcoords etc...)
     Integrated proprietary C compiler to allow script compilation inside the IDE (in native Intel 80x86 code or in pseudo-code for execution by a virtual machine).
     Proprietary script language parser for defining entity behavior and properties.
     Powerful and intuitive user interface (scrollable toolbars and dialogs, ActiveX controls, customizable menus, full shader properties editing in UI etc...).
     Integrated BSP, PVS, lightmap generators.
     Editing windows with highlighted syntax for C code and entity scripts.
     Support for groups, named selections, clipboard operations etc...

INTRODUCTION

MapGen is a powerful CSG editor and an integrated environment for developing maps, scripts and content from the same IDE, developed entirely by Vito Plantamura in 1999. It includes also a proprietary C compiler and a BSP and PVS compiler. MSC is a plugin for 3DStudio Max 3.1 that allows to export characters (eventually bipeds with physique information) and to import materials. Modeler is an application that is useful for creating and composing animations. All the tools comunicate through DCOM achieving a full location transparency.

OLE AUTOMATION

As my current professional focus (in 2005, at the time of this writing) is on component software and on Microsoft technologies in general, I'll put emphasis in this section on the OLE Automable features of MapGen. As a side note, I developed the MapGen OLE Automation server (with ISupportErrorInfo features) in 1999 entirely in C++ without the aid of any higher level framework.

You can view a detailed description of the MapGen Type Library opening the MapGenGeom.tlb file with OLE View. This is a very concise surrogate of that information:

// MapGen.idl
 
interface IMapGen3DVector : IDispatch
{
      HRESULT x ([out, retval] float* pRetVal);
      HRESULT x ([in] float sX);
      HRESULT y ([out, retval] float* pRetVal);
      HRESULT y ([in] float sY);
      HRESULT z ([out, retval] float* pRetVal);
      HRESULT z ([in] float sZ);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT copyVector ([in] IMapGen3DVector* pSourceVector);
      HRESULT setVector ([in, optional, defaultvalue(0)] float sX, [in, optional, defaultvalue(0)] float sY, [in, optional, defaultvalue(0)] float sZ);
      HRESULT lengthOfVector ([out, retval] float* pRetVal);
      HRESULT normalizeVector ();
      HRESULT crossproductOf2Vectors ([in] IMapGen3DVector* pFirstVector, [in] IMapGen3DVector* pSecondVector);
      HRESULT dotproductWithVector ([in] IMapGen3DVector* pSecondVector, [out, retval] float* pRetVal);
      HRESULT addVector ([in] IMapGen3DVector* pSecondVector);
      HRESULT subtractVector ([in] IMapGen3DVector* pSecondVector);
      HRESULT multiplyByScalar ([in] float sScalar);
      HRESULT maxComponent ([out, retval] E3DVectorComponent* pRetVal);
      HRESULT minComponent ([out, retval] E3DVectorComponent* pRetVal);
      HRESULT duplicateVector ([out, retval] IMapGen3DVector** pRetVal);
};
 
interface IMapGen2DTexCoords : IDispatch
{
      HRESULT s ([out, retval] float* pRetVal);
      HRESULT s ([in] float sS);
      HRESULT t ([out, retval] float* pRetVal);
      HRESULT t ([in] float sT);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
};
 
interface IMapGen3DBoundingBox : IDispatch
{
      HRESULT min ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT max ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
};
 
interface IMapGen4x3Matrix : IDispatch
{
      HRESULT setMatrix ([in] IMapGen3DVector* pRow0, [in] IMapGen3DVector* pRow1, [in] IMapGen3DVector* pRow2, [in] IMapGen3DVector* pRow3);
      HRESULT getMatrixRow ([in] int iIndex, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT setIdentity ();
      HRESULT generateTranslationMatrix ([in] IMapGen3DVector* pTranslation);
      HRESULT generateTranslationMatrix3s ([in] float sX, [in] float sY, [in] float sZ);
      HRESULT generateScalingMatrix ([in] IMapGen3DVector* pScale);
      HRESULT generateScalingMatrix3s ([in] float sX, [in] float sY, [in] float sZ);
      HRESULT generateXRotationMatrix ([in] float sAngle);
      HRESULT generateYRotationMatrix ([in] float sAngle);
      HRESULT generateZRotationMatrix ([in] float sAngle);
      HRESULT generateRotationMatrix ([in] float sXAngle, [in] float sYAngle, [in] float sZAngle);
      HRESULT generateVectorRotationMatrix ([in] IMapGen3DVector* pVector, [in] float sAngle);
      HRESULT generateVectorRotationMatrix3s ([in] float sX, [in] float sY, [in] float sZ, [in] float sAngle);
      HRESULT multiplyWithMatrix ([in] IMapGen4x3Matrix* pSecondMatrix, [out, retval] IMapGen4x3Matrix** pRetVal);
      HRESULT multiplyWithVector ([in] IMapGen3DVector* pVector, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT duplicateMatrix ([out, retval] IMapGen4x3Matrix** pRetVal);
};
 
interface IMapGenSelectionStatus : IDispatch
{
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT restoreSelectedGroup ();
      HRESULT restoreSelection ();
};
 
interface IMapGenBrush : IDispatch
{
      HRESULT selectSingly ();
      HRESULT isSelected ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT classOfBrush ([out, retval] EBrushClass* pRetVal);
      HRESULT centerOfBrush ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT bboxOfBrush ([out, retval] IMapGen3DBoundingBox** pRetVal);
      HRESULT numOfBrushFaces ([out, retval] int* pRetVal);
      HRESULT getBrushFace ([in] int iIndex, [out, retval] IMapGenFace** pRetVal);
      HRESULT newBrushFace ([out, retval] IMapGenFace** pRetVal);
      HRESULT deleteBrushFaceIndexed ([in] int iIndex);
      HRESULT patchOfBrush ([out, retval] IMapGenPatch** pRetVal);
      HRESULT patchOfBrush ([in] IMapGenPatch* pPatch);
      HRESULT deleteBrushFace ([in] IMapGenFace* pFace);
      HRESULT isSelectedSingly ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT updateBrushState ();
};
 
interface IMapGenFace : IDispatch
{
      HRESULT isSelected ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT isSelected ([in] VARIANT_BOOL bIsSelected);
      HRESULT normalOfFacePlane ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT normalOfFacePlane ([in] IMapGen3DVector* pNormal);
      HRESULT distanceOfFacePlane ([out, retval] float* pRetVal);
      HRESULT distanceOfFacePlane ([in] float sDistance);
      HRESULT numOfFaceVertices ([out, retval] int* pRetVal);
      HRESULT getFaceVertex ([in] int iIndex, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT offsetX ([out, retval] float* pRetVal);
      HRESULT offsetX ([in] float sOffsetX);
      HRESULT offsetY ([out, retval] float* pRetVal);
      HRESULT offsetY ([in] float sOffsetY);
      HRESULT scaleX ([out, retval] float* pRetVal);
      HRESULT scaleX ([in] float sScaleX);
      HRESULT scaleY ([out, retval] float* pRetVal);
      HRESULT scaleY ([in] float sScaleY);
      HRESULT angleOfRotation ([out, retval] float* pRetVal);
      HRESULT angleOfRotation ([in] float sAngle);
      HRESULT viewInEditorPanes ();
      HRESULT viewInPerspPane ();
      HRESULT recalcST ();
      HRESULT fitTextureInFace ([in, optional, defaultvalue(1)] int iXRepetitions, [in, optional, defaultvalue(1)] int iYRepetitions);
      HRESULT shaderOfFace ([out, retval] IMapGenShader** pRetVal);
      HRESULT shaderOfFace ([in] IMapGenShader* pShader);
      HRESULT copySettings ();
      HRESULT pasteSettings ();
      HRESULT resetSettings ();
      HRESULT getFaceAttributeBit ([in] int iIndex, [out, retval] VARIANT_BOOL* pRetVal);
      HRESULT setFaceAttributeBit ([in] int iIndex, [in] VARIANT_BOOL bBitStatus);
      HRESULT attributesOfFace ([out, retval] unsigned int* pRetVal);
      HRESULT attributesOfFace ([in] unsignedint uiAttributes);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT vectorS ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT vectorS ([in] IMapGen3DVector* pVectorS);
      HRESULT vectorT ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT vectorT ([in] IMapGen3DVector* pVectorT);
      HRESULT applySelectedShader ();
};
 
interface IMapGenPatch : IDispatch
{
      HRESULT numOfColumns ([out, retval] int* pRetVal);
      HRESULT numOfRows ([out, retval] int* pRetVal);
      HRESULT getControlPoint ([in] int iColumn, [in] int iRow, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT offsetX ([out, retval] float* pRetVal);
      HRESULT offsetX ([in] float sOffsetX);
      HRESULT offsetY ([out, retval] float* pRetVal);
      HRESULT offsetY ([in] float sOffsetY);
      HRESULT scaleX ([out, retval] float* pRetVal);
      HRESULT scaleX ([in] float sScaleX);
      HRESULT scaleY ([out, retval] float* pRetVal);
      HRESULT scaleY ([in] float sScaleY);
      HRESULT angleOfRotation ([out, retval] float* pRetVal);
      HRESULT angleOfRotation ([in] float sAngle);
      HRESULT shaderOfPatch ([out, retval] IMapGenShader** pRetVal);
      HRESULT shaderOfPatch ([in] IMapGenShader* pShader);
      HRESULT textureNaturally ();
      HRESULT fitTextureInPatch ([in, optional, defaultvalue(1)] int iXRepetitions, [in, optional, defaultvalue(1)] int iYRepetitions);
      HRESULT textureAsCap ();
      HRESULT insert2Columns ();
      HRESULT add2Columns ();
      HRESULT insert2Rows ();
      HRESULT add2Rows ();
      HRESULT deleteFirst2Columns ();
      HRESULT deleteLast2Columns ();
      HRESULT deleteFirst2Rows ();
      HRESULT deleteLast2Rows ();
      HRESULT invertControlPoints ();
      HRESULT redisperseColumns ();
      HRESULT redisperseRows ();
      HRESULT putCapsOnPatch ([in, optional, defaultvalue(ECT_Automatic)] ECappingType eCappingType);
      HRESULT thickenPatch ([in, optional, defaultvalue(-1)] float sAmount, [in] VARIANT_BOOL bCreateSeams);
      HRESULT getPatchAttributeBit ([in] int iIndex, [out, retval] VARIANT_BOOL* pRetVal);
      HRESULT setPatchAttributeBit ([in] int iIndex, [in] VARIANT_BOOL bBitStatus);
      HRESULT attributesOfPatch ([out, retval] unsigned int* pRetVal);
      HRESULT attributesOfPatch ([in] unsignedint uiAttributes);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT getControlPointTexCoords ([in] int iColumn, [in] int iRow, [out, retval] IMapGen2DTexCoords** pRetVal);
      HRESULT numOfSelectedControlPoints ([out, retval] int* pRetVal);
      HRESULT getSelectedControlPoint ([in] int iIndex, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT applySelectedShader ();
};
 
interface IMapGenEntity : IDispatch
{
      HRESULT idOfEntity ([out, retval] BSTR* pRetVal);
      HRESULT idOfEntity ([in] BSTR bstrName);
      HRESULT getParameter ([in] BSTR bstrParameter, [out, retval] VARIANT* pRetVal);
      HRESULT setParameter ([in] BSTR bstrParameter, [in] VARIANT vValue);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT nameOfEntity ([out, retval] BSTR* pRetVal);
      HRESULT stringOfEntity ([out, retval] BSTR* pRetVal);
};
 
interface IMapGenShaderFile : IDispatch
{
      HRESULT nameOfFile ([out, retval] BSTR* pRetVal);
      HRESULT nameOfFile ([in] BSTR bstrName);
      HRESULT nameOfShaderCollection ([out, retval] BSTR* pRetVal);
      HRESULT nameOfShaderCollection ([in] BSTR bstrName);
      HRESULT isDirty ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT saveOnDisk ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT numOfShaders ([out, retval] int* pRetVal);
      HRESULT getShader ([in] int iIndex, [out, retval] IMapGenShader** pRetVal);
      HRESULT addShader ([out, retval] IMapGenShader** pRetVal);
      HRESULT removeShaderIndexed ([in] int iIndex);
      HRESULT removeShader ([in] IMapGenShader* pShader);
};
 
interface IMapGenTexture : IDispatch
{
      HRESULT nameOfTexture ([out, retval] BSTR* pRetVal);
      HRESULT nameOfTexture ([in] BSTR bstrName);
      HRESULT widthOfTexture ([out, retval] int* pRetVal);
      HRESULT widthOfTexture ([in] int iWidth);
      HRESULT heightOfTexture ([out, retval] int* pRetVal);
      HRESULT heightOfTexture ([in] int iHeight);
      HRESULT dataOfTexture ([out, retval] VARIANT* pRetVal);
      HRESULT dataOfTexture ([in] VARIANT vData);
      HRESULT isRepresentative ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT isRepresentative ([in] VARIANT_BOOL bIsRepresentative);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT shaderOwning ([out, retval] IMapGenShader** pRetVal);
};
 
interface IMapGenShader : IDispatch
{
      HRESULT fileOwning ([out, retval] IMapGenShaderFile** pRetVal);
      HRESULT fileOwning ([in] IMapGenShaderFile* pShaderFile);
      HRESULT nameOfShader ([out, retval] BSTR* pRetVal);
      HRESULT nameOfShader ([in] BSTR bstrName);
      HRESULT guidOfShader ([out, retval] BSTR* pRetVal);
      HRESULT guidOfShader ([in] BSTR bstrName);
      HRESULT textureToUser ([out, retval] IMapGenTexture** pRetVal);
      HRESULT textureToUser ([in] IMapGenTexture* pTexture);
      HRESULT parentOfShader ([out, retval] IMapGenShader** pRetVal);
      HRESULT parentOfShader ([in] IMapGenShader* pShader);
      HRESULT numOfChildren ([out, retval] int* pRetVal);
      HRESULT getChildShader ([in] int iIndex, [out, retval] IMapGenShader** pRetVal);
      HRESULT numOfTextures ([out, retval] int* pRetVal);
      HRESULT getShaderTexture ([in] int iIndex, [out, retval] IMapGenTexture** pRetVal);
      HRESULT setShaderTexture ([in] int iIndex, [in] IMapGenTexture* pTexture);
      HRESULT nameOfFunction ([out, retval] BSTR* pRetVal);
      HRESULT nameOfFunction ([in] BSTR bstrName);
      HRESULT getFaceAttribute ([in] int iIndex, [out, retval] BSTR* pRetVal);
      HRESULT setFaceAttribute ([in] int iIndex, [in] BSTR bstrAttribute);
      HRESULT descOfShader ([out, retval] BSTR* pRetVal);
      HRESULT descOfShader ([in] BSTR bstrDesc);
      HRESULT isValid ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT replaceShaderTexture ([in] IMapGenTexture* pOldTexture, [in] IMapGenTexture* pNewTexture);
};
 
interface IMapGenGeometries : IDispatch
{
      HRESULT unselectAll ();
      HRESULT cutSelection ();
      HRESULT copySelection ();
      HRESULT pasteSelection ();
      HRESULT cloneSelection ();
      HRESULT deleteSelection ();
      HRESULT canScopeUp ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT gotoScopeUp ();
      HRESULT canScopeDown ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT gotoScopeDown ();
      HRESULT ungroupSelection ();
      HRESULT hollowSelection ();
      HRESULT subtractSelection ([in, optional, defaultvalue(FALSE)] VARIANT_BOOL bFromSelectedGroup);
      HRESULT simmetryOnSelection ([in] ESimmetryAxis eSimmetryAxis);
      HRESULT translateSelection3s ([in] float sX, [in] float sY, [in] float sZ);
      HRESULT rotateSelection4s ([in] float sAngle, [in] float sX, [in] float sY, [in] float sZ);
      HRESULT scaleSelection3s ([in] float sX, [in] float sY, [in] float sZ);
      HRESULT numOfGroups ([out, retval] int* pRetVal);
      HRESULT selectGroup ([in] int iIndex);
      HRESULT numOfSelectedBrushes ([out, retval] int* pRetVal);
      HRESULT getSelectedBrush ([in] int iIndex, [out, retval] IMapGenBrush** pRetVal);
      HRESULT nameOfSelection ([out, retval] BSTR* pRetVal);
      HRESULT nameOfSelection ([in] BSTR bstrName);
      HRESULT centerOfSelection ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT bboxOfSelection ([out, retval] IMapGen3DBoundingBox** pRetVal);
      HRESULT createBrush ([in] EBrushType eBrushType, [out, retval] IMapGenBrush** pRetVal);
      HRESULT addBrush ([in] EBrushType eBrushType, [out, retval] IMapGenBrush** pRetVal);
      HRESULT selectShader ([in] BSTR bstrName, [in, optional, defaultvalue(FALSE)] VARIANT_BOOL bIsGUID);
      HRESULT shaderSelected ([out, retval] IMapGenShader** pRetVal);
      HRESULT shaderSelected ([in] IMapGenShader* pShader);
      HRESULT lockOfTextures ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT lockOfTextures ([in] VARIANT_BOOL bLock);
      HRESULT zoomOnSelection ();
      HRESULT lockUserInterface ();
      HRESULT unlockUserInterface ();
      HRESULT enterSafeState ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT newShaderFile ([out, retval] IMapGenShaderFile** pRetVal);
      HRESULT numOfShaderFiles ([out, retval] int* pRetVal);
      HRESULT getShaderFile ([in] int iIndex, [out, retval] IMapGenShaderFile** pRetVal);
      HRESULT newFreeTexture ([out, retval] IMapGenTexture** pRetVal);
      HRESULT createBrushCopy ([in] IMapGenBrush* pBrush, [out, retval] IMapGenBrush** pRetVal);
      HRESULT addBrushCopy ([in] IMapGenBrush* pBrush, [out, retval] IMapGenBrush** pRetVal);
      HRESULT newEntityOnSelection ([out, retval] IMapGenEntity** pRetVal);
      HRESULT entityOfSelection ([out, retval] IMapGenEntity** pRetVal);
      HRESULT entityOfSelection ([in] IMapGenEntity* pEntity);
      HRESULT createBrushEntity ([in] BSTR bstrEntityID, [out, retval] IMapGenBrush** pRetVal);
      HRESULT addBrushEntity ([in] BSTR bstrEntityID, [out, retval] IMapGenBrush** pRetVal);
      HRESULT new3DVector3s ([in, optional, defaultvalue(0)] float sX, [in, optional, defaultvalue(0)] float sY, [in, optional, defaultvalue(0)] float sZ, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT weldControlPointsOfDifferentPatches ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT weldControlPointsOfDifferentPatches ([in] VARIANT_BOOL bWeldCP);
      HRESULT canUndoLast ([out, retval] VARIANT_BOOL* pRetVal);
      HRESULT undoLast ();
      HRESULT newMatrix ([out, retval] IMapGen4x3Matrix** pRetVal);
      HRESULT transformSelection ([in] IMapGen4x3Matrix* pMatrix);
      HRESULT translateSelection ([in] IMapGen3DVector* pVector);
      HRESULT scaleSelection ([in] IMapGen3DVector* pVector);
      HRESULT new3DVector ([in, optional] IMapGen3DVector* pVector, [out, retval] IMapGen3DVector** pRetVal);
      HRESULT rotateSelection ([in] float sAngle, [in] IMapGen3DVector* pVector);
      HRESULT selectionStatus ([out, retval] IMapGenSelectionStatus** pRetVal);
      HRESULT positionOfEditorPanes ([out, retval] IMapGen3DVector** pRetVal);
      HRESULT positionOfEditorPanes ([in] IMapGen3DVector* pPosition);
};

In order to expose the OLE Automation objects to the outside world, the "Expose Project" button has to be clicked in the designer interface:



Doing so will register with COM the class factories of the exposed objects. For a little example that I've developed on the fly, I am using Visual Basic 6 as the Automation Controller.



After having included the MapGen Type Library in the Visual Basic References, you are ready to type in the controlling code. In the click handler of a button control, we may set the following code:

Dim Geom As MapGenGeometries
Dim Brush As IMapGenBrush
 
Set Geom = CreateObject("MapGen.Geometries") ' get root object
 
Set Brush = Geom.createBrush(EBT_Trapezoid) ' create a trapezoid. the brush will be selected.
Call Geom.rotateSelection(32, Geom.new3DVector3s(1, 0, 0)) ' rotate 32 degrees along X axis.
 
Set Brush = Geom.createBrush(EBT_LargeCube) ' create a cube.
Call Geom.hollowSelection ' make the cube hollow.
 
Set Brush = Geom.createBrush(EBT_Cylinder) ' create a patched cylinder.
Call Geom.scaleSelection3s(2, 2, 2) ' grow its dimension.
Call Geom.translateSelection3s(0, 0, -256) ' translate it along the Z axis.
 
Set Geom = Nothing ' release.

After running it, clicking the button will cause the following structure to be created in the designer:



Consider that this is a very simple example of an automation controller that can be written for MapGen. If you look at the Type Library interfaces and methods, you will see that a lot of the editor functionalities have been exposed to the outside world through OLE Automation thus allowing an high degree of freedom and detail when controlling the application...

INSTALLATION

Extract the archive contents into a directory in your hard drive. The MapGen editor and MapGen Modeler can be executed directly from there. Copy the plugin module of Server Control (MSC.dlu) into the plugin directory of your Max 3.1 installation (typically #MaxDir#\Plugins).

APPLICATION USAGE TIPS

These are some few tips for using the tools. They are intended to give some initial confidence with all the tools of the technology. MapGen editor, for example, is a very complex and full featured application: it requires a book of its own to cover all the utilization details!

MapGen editor TIPS.

General Tips.

For brush and patch editing, having a three-button mouse with wheel is very suitable. This can allow you to increase a lot the speed and pleasure of brush editing.

The UI of the MapGen editor makes extensive use of scrollable dialogs, panes and toolbars. As a general rule, you can scroll the views pressing the mouse right button and/or using the left button in areas not covered by controls or other objects. The object toolbar, for example, typically extents over the screen limits, so, for viewing all the items, you can scroll the bar to the left pressing the right button and moving the mouse.

Mouse Tips.

Pressing (Alt+1) key combination you can activate the freehand mode. In the editor panes, clicking the left mouse button has the effect of moving the selected brush. If you click outside the selected brush, you'll be able to resize the primitive (keep pressed the shift key to translate the face near to the mouse pointer). If you click the left button and no brush is currently selected, MapGen will create a new brush whose dimensions are defined by the next mouse movements. The type and class of the brush created are determined by the current selection in the three-combo toolbar named "Object Wizard".

Pressing the right mouse button in the editor panes has the effect of moving the current view in the 3d world.

Pressing the middle mouse button in the editor panes has an effect that depends on the number of currently selected brushes and on the actual drawing mode. If no brush is selected, MapGen will switch the drawing mode from "freehand" to "select" and viceversa. If one brush is selected and freehand is the current drawing mode, that brush will become unselected. In contrast, if an other drawing mode is active, MapGen will restore the freehand mode as the current mode. If two or more brushes are selected and freehand mode is active, all the brushes will become unselected. If an other drawing mode is active, MapGen will switch at each middle mouse button click between select and translate mode.

The behaviour of perspective pane at mouse clicks is different from the other editor panes. You can use the left and right mouse buttons to explore the world you are creating. Pressing the middle button has the same effect as in the other panes. If you click the left button on a brush in the perspective pane and then immediately release the mouse button, MapGen will select the brush, patch or point that is pointed by the cursor. If you point a group, that group will become selected. If you want to select only a single brush and not an entire group, do the same operation keeping pressed the ctrl key.

You can use the mouse wheel to increase or decrease the zoom factor of the editor panes.

Shaders

When you create a new primitive, MapGen will use the currently selected shader for covering the new brush faces. You can select a new shader by activating the project window, pressing the shaders tab and then clicking on a shader with the left mouse button. If you click the right mouse button instead, you will be able to modify some options of the shader browser, or delete the pointed shader or create a new one. Double-click with the left button on a shader to edit its properties.

MapGen allows having more than one shader file currently loaded in memory. Use the combo box in the "Shader Files" toolbar to select the current shader file.

Patch Editing.

If you select one patch, you can also edit it. To do this, select the freehand mode as the current drawing mode. Activate the "Selection Properties" window and then click on the "Surface" tab. At this point, you'll see the patch control points in all the editor panes. Refer to the "Patch Mode" toolbar for selecting the current patch editing mode. Press the shift key to rotate between the available modes: "Normal" freehand mode, "Selection" mode, for selecting one or more control points, "Rotate" mode and "Scale" mode for transforming the selected control points. When in "Selection" mode, use the ctrl and alt keys to control inclusion or exclusion of points. When in "Rotate" or "Scale" mode, you can click on a selected control point to prevent the transformation, allowing you to simply translate the selection of control points.

Modeler and Server Control TIPS.

Exporting Animations From Max 3.1.

Open 3DStudio Max 3.1, load a biped model, go to the "Utilities" pane and launch the "MapGen Server Control" plugin, previously copied in the plugins directory of Max. Launch also the Modeler application. The two sides will communicate through DCOM: you can type in the "Server Name" edit box of the plugin the name of the computer on which Modeler is currently running ("Local Computer" is the default). Type a name for the animation and then click "Export". After several seconds, the animation data will appear in the "Incoming Animations" window of the Modeler application. Then, in Modeler, double-click on the name previously entered in MAX (that now appears in the list) and the animation will be added to the current document. If no document is currently open, Modeler will create a new one for you.

Importing MapGen Shaders As Materials In Max 3.1.

Open 3DStudio Max 3.1, go to the "Utilities" pane and activate the "MapGen Server Control" plugin. You need to do this first, so the plugin can initialize the DCOM server that listens for incoming shaders from MapGen. Launch the MapGen editor and go to the shader browser (open the project window and then click on the shaders tab). Clicking with the right mouse button on a shader will bring up a context menu: select "Send To 3DStudio Max R3.1". Return to Max, and click the "Import" button. If you open the "Material Editor" window of Max, you'll see the imported shader in a slot of that window.

DOWNLOAD

Download MapGen Build 4676 (binaries only) from here (1514KB).

The archive includes a full implemented version of the MapGen editor (a q3radiant-like csg editor), a beta version of the MapGen Modeler (a tool that can be used to create animations) and a full implemented version of the MapGen Server Control (a plugin for 3DStudio Max 3.1 that can export mesh and biped information).

The archive contents are as follows:

     bones.max: example mesh with biped.
     default.ent: entity definition file.
     MapGen2.exe: MapGen editor executable.
     MapGenGeom.tlb: MapGen Object Model type library.
     MapGenGeometriesPS.dll: MapGen Object Model proxy/stub module.
     MODELER.exe: MapGen Modeler executable.
     MSC.dlu: MapGen Server Control plugin for 3DStudio Max 3.1.

 Quotes
"Among the Windows experts I know personally, no one can beat Vito Plantamura."
- Francesco Balena, Code Architects SRL

"Your NDIS Monitor application, is amongst the most impressive networking code I have seen on the .Net framework."
- Ben Hakim.
 Photos
Various images from italian conferences and events (keep the mouse on a thumbnail for a short description):
Me at the Microsoft/HP/Intel organized Route64 event in Milan in May 2005, explaining how COM+ behaves on 64-bit Microsoft operating systems. I was there with the friends of Code Architects.
Me at the Microsoft Security Roadshow event in Bari in April 2006, explaining how the logon process works in Windows NT. There were 250 attendees.
Microsoft Security Roadshow 2006 in Treviso. This is an image of the huge 700-seats conference room.
Me at the Microsoft Security Roadshow 2006 in Treviso. This is a moment of the 3-hours session.
 Site login
NOTE: Actually the login feature is used only for administrative and content management purposes.
Username

Password

Everything here (code, binaries, text, graphics, design, html) is © 2010 Vito Plantamura and VPC Technologies SRL (VATID: IT06203700965).
If you download something (compilable or not) from the site, you should read the license policy file.
If you want to contact me via email, write at this address.