<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://horde3d.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roland</id>
		<title>Horde3D Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://horde3d.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Roland"/>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Special:Contributions/Roland"/>
		<updated>2026-09-30T21:59:13Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.3</generator>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=DCC_Tool_Support&amp;diff=729</id>
		<title>DCC Tool Support</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=DCC_Tool_Support&amp;diff=729"/>
				<updated>2013-04-16T11:46:10Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: Updated OpenCollada link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__{{ContentBlock|color=white|content={{!!}}&lt;br /&gt;
== Textures ==&lt;br /&gt;
&lt;br /&gt;
Horde3D can load textures from standard image formats (TGA, JPEG, PNG, BMP, PSD, HDR), so virtually any image editing software can be used to create textures. Note however, that some more exotic features of these formats like progressive JPEGs are not supported.&lt;br /&gt;
&lt;br /&gt;
Besides the mentioned formats, Horde3D can directly load DDS (Direct Draw Surface) textures. DDS files can store less common texture types like cube maps or volume textures. They can also store data in a DXT compressed format which is understood directly by the graphics hardware. Since no decompression is required, loading DDS files is usually much more efficient than loading compressed JPEG or PNG images.&lt;br /&gt;
&lt;br /&gt;
The following tools are especially useful for creating DDS files:&lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/nv_texture_tools.html NVidia Texture Tools]&lt;br /&gt;
* [http://developer.amd.com/gpu/cubemapgen/pages/default.aspx ATI CubeMapGen]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ee417856%28VS.85%29.aspx DxTex.exe (in DirectX SDK)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Models and Animations ==&lt;br /&gt;
&lt;br /&gt;
Horde3D uses Collada as source format for 3d assets, so it supports a wide range of modeling applications. However, since Collada is a complex format which provides several ways to store the same data, the Collada output that a DCC tool produces may have some slight incompatibility with Horde's ColladaConv. Luckily, these problems are usually easy to fix and in fact the range of supported applications has already increased a lot over time. If you have a Collada file that is not working with Horde, feel free to give a shout in the forums.&lt;br /&gt;
&lt;br /&gt;
=== Collada Compatibility===&lt;br /&gt;
&lt;br /&gt;
* '''3D Studio Max 2009 and older'''&lt;br /&gt;
** Recommended exporter: [http://sourceforge.net/projects/colladamaya/ Feeling Software ColladaMax]&lt;br /&gt;
** Notes:&lt;br /&gt;
*** Very well tested. Full support for static and skinned meshes with animations and morph targets.&lt;br /&gt;
*** Always enable '''animation sampling''' and '''triangulation''' in the export options.&lt;br /&gt;
* '''3D Studio Max 2010 and newer'''&lt;br /&gt;
** The included Autodesk Collada Exporter works for static and skinned meshes using biped, cat-rigs, and bones. Make sure to use the latest FBX Plug-in version (latest testet version using 3DsMax 2011 is plug-in version 2012.2). &lt;br /&gt;
*** Successfully used exporter settings:&amp;lt;br&amp;gt;[[Image:autodeskcolladaexporter.png|x250px|link=http://www.horde3d.org/wiki/images/c/c9/Autodeskcolladaexporter.png]]&amp;lt;br&amp;gt;(click on image to enlarge).&lt;br /&gt;
** Notes:&lt;br /&gt;
*** Autodesk Collada Exporter PlugIn of 3D Studio Max 2011 and 3D Studio Max 2012 does't support grouped objects, you should use the OpenCOLLADA exporter below.&lt;br /&gt;
**  The [https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools OpenCOLLADA exporter] version 1.3.1 was successfully used to export static and skinned meshes which included morphtargets on top of the skinned geometry. Small problems occurring in the morphtarget naming scheme can be solved by editing the .dea file in a texteditor.&lt;br /&gt;
*** Successfully used exporter settings:&amp;lt;br&amp;gt;[[Image:Opencollada.png|x100px|link=http://www.horde3d.org/wiki/images/a/ad/Opencollada.png]]&amp;lt;br&amp;gt;(click on image to enlarge).&lt;br /&gt;
* '''Maya'''&lt;br /&gt;
** Recommended exporter: [http://sourceforge.net/projects/colladamaya/ Feeling Software ColladaMaya]&lt;br /&gt;
** Notes:&lt;br /&gt;
***  ColladaMaya uses the same code base as ColladaMax (FCollada), so the support should be good as well.&lt;br /&gt;
* '''Modo'''&lt;br /&gt;
** See [[Collada_-_Modo]]&lt;br /&gt;
&lt;br /&gt;
''The list above is not complete. The Collada output of many more DCC applications is supported, however someone actually working with them should please add reliable information about the level of support.''&lt;br /&gt;
&lt;br /&gt;
=== Special Exporters and Converters ===&lt;br /&gt;
&lt;br /&gt;
In general, using Collada should be preferred over having custom exporters. The reason for this is that ColladaConv does a fair amount of data conditioning and optimization which would have to be implemented for each exporter individually. However, some modeling tools don't have proper Collada export, so custom tools are required for them.&lt;br /&gt;
&lt;br /&gt;
==== Blender Exporter ====&lt;br /&gt;
&lt;br /&gt;
Blender has basic support for exporting Collada but skinning and animations are not working properly. For that reason, a direct [[Direct Export from Blender|Exporter for Horde3D]] is available.&lt;br /&gt;
&lt;br /&gt;
==== AC3D Converter ====&lt;br /&gt;
&lt;br /&gt;
jimbo has written a converter to bring AC3D .ac files to the Horde3D format. The converter with full source code can be downloaded from [http://www.daansystems.com/ac3d2horde3d here].&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Scene_Editor&amp;diff=724</id>
		<title>Horde3D Scene Editor</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Scene_Editor&amp;diff=724"/>
				<updated>2012-08-14T10:24:17Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|  border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=1024|color=white&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
&lt;br /&gt;
=== Editor Features ===&lt;br /&gt;
The Horde3D Scene Editor offers an easy to use interface for the Horde3D graphics engine&lt;br /&gt;
&lt;br /&gt;
Some of the key features are:&lt;br /&gt;
&lt;br /&gt;
* Interface for creating and modifying Horde3D scene graph files&lt;br /&gt;
* Instant resource reloading for files modified outside the editor making it possible to use the editor for shader development&lt;br /&gt;
* LUA scripting support for rapid prototyping of small applications directly in the editor&lt;br /&gt;
* Powerful plugin architecture for integration of game engine functionality and executing game code, physics, etc. directly in the editor&lt;br /&gt;
* Cross-platform compatibility&lt;br /&gt;
* Open-source code released under the GPL &lt;br /&gt;
&lt;br /&gt;
The current official version is version 0.8.0 compatible with Horde3D v.1.0.0 Beta2.&lt;br /&gt;
&lt;br /&gt;
A more recent version can be found in the [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/Tools/Horde3DEditor/ Community Branch] that is compatible with Horde3D v.1.0.0 Beta5.&lt;br /&gt;
In the repository there are also CMake configuration files to build the entire editor with all editor plugins and the Horde3D engine itself. Note that at least CMake 2.8.3 is required.&lt;br /&gt;
&lt;br /&gt;
Thanks to our forum member Irdis, a windows binary release of the editor compatible with Horde3D Beta5 can be found [http://horde3d.org/forums/viewtopic.php?p=8263#p8263 here]. Note that you must have [http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx OpenAL] installed on your system to use it.&lt;br /&gt;
&lt;br /&gt;
=== Preliminary Documentation ===&lt;br /&gt;
A preliminary [http://mm-werkstatt.informatik.uni-augsburg.de/files/project_content/45/231_HordeEditor.pdf PDF documentation] can be found on the project [http://mm-werkstatt.informatik.uni-augsburg.de/Horde3DEditor website]. In the future it will be transferred to the wiki to allow the community to improve the documentation as well.&lt;br /&gt;
&lt;br /&gt;
=== Tutorial Video === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;VideoFlv width=&amp;quot;1024&amp;quot; height=&amp;quot;768&amp;quot;&amp;gt;http://mm-werkstatt.informatik.uni-augsburg.de/files/project_content/45/Horde3D_Editor.flv&amp;lt;/VideoFlv&amp;gt;&lt;br /&gt;
You can also [http://mm-werkstatt.informatik.uni-augsburg.de/downloads/Horde3D_Editor.avi download this video] in an [http://www.xvid.org  Xvid] coded version! &lt;br /&gt;
&lt;br /&gt;
== Overview of the Horde3D Scene Editor ==&lt;br /&gt;
&lt;br /&gt;
The Horde3D graphics engine is a SDK for rendering three dimensional data. The interface to the graphics data is deﬁned by a Horde3D speciﬁc ﬁle format. Normally you will create a 3D model in your favourite modelling tool like 3Ds Max or Blender and export the data to a Collada ﬁle. This ﬁle can then be converted by the Horde3D Collada converter to the internal Horde3D format.&lt;br /&gt;
&lt;br /&gt;
But what if you want to compose a scene where several single models should&lt;br /&gt;
be integrated. The ﬁrst possibility is to use your modelling tool, compose&lt;br /&gt;
everything in it and export the whole scenery to create one big Horde3D ﬁle.&lt;br /&gt;
But doing it this way suffers still from the lack of possibility to illuminate&lt;br /&gt;
your scene with Horde3D lights and visualize it with your custom shaders.&lt;br /&gt;
That’s why the second possibility was created: the Horde3D Scene Editor!&lt;br /&gt;
It will create scene graph files readable by Horde3D, let you integrate your&lt;br /&gt;
custom attachment nodes by using plugins, offers fast prototyping by pro-&lt;br /&gt;
viding a Lua interface to all Horde3D functions and also let you instantly&lt;br /&gt;
preview changes to shader code, materials, eﬀects, textures and pipelines by reloading&lt;br /&gt;
the changed files immediately and automatically after saving them.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
For the Horde3D Scene Editor a graphical installer is provided for the Microsoft Windows platform. You can download the latest release from the &lt;br /&gt;
[http://mm-werkstatt.informatik.uni-augsburg.de/project_details.php?id=45 project website]. Release candidates for upcoming versions might be released in the [http://horde3d.org/forums/viewforum.php?f=6 Tools section] of the forums. Currently the Editor supports two different platforms: Windows and Linux! It may be used on the Macintosh platform as well, but since I (volker) don’t have access to a Mac I haven’t tested this yet.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
After downloading and extracting the compressed archive you simply have&lt;br /&gt;
to run the Setup.exe. It will guide you through the rest of the installation&lt;br /&gt;
procedure. After installation has been done, a Horde3D Scene Editor link&lt;br /&gt;
has been created in your start menu and the ﬁle extension .scn has been associated with the editor. The installation directory will contain an executable as well as the source code and a Visual Studio 2005 solution.&lt;br /&gt;
&lt;br /&gt;
==== Compiling the Editor ====&lt;br /&gt;
&lt;br /&gt;
==== Visual Studio ====&lt;br /&gt;
To compile the Editor yourself with Visual Studio 2008 or 2010:&lt;br /&gt;
# Download the [http://qt-project.org/downloads#qt-lib Qt libraries for Windows]. Make sure to choose the correct file (VS 2008 or VS 2010)!&lt;br /&gt;
# Install the libraries and remember the path (e.g. C:\Qt )&lt;br /&gt;
# Set your environment variables (Control Panel\System\Environment Variables):&lt;br /&gt;
## Add a new user-variable &amp;quot;QTDIR&amp;quot; and set it to the Qt folder (e.g. ''c:\Qt\4.8.2'' ).&lt;br /&gt;
## Add the directory of Qt's bin-folder to the system &amp;quot;Path&amp;quot;-variable (e.g. ''C:\Qt\4.8.2\bin;'').&lt;br /&gt;
# Restart your pc.&lt;br /&gt;
# Open the solution ''Horde3DEditor_XXXX_with_GameEngine.sln'' (2008/2010 depending on your VS version) and build it.&lt;br /&gt;
&lt;br /&gt;
==== Visual Studio 2005 ====&lt;br /&gt;
If you want to compile the Editor yourself with Visual Studio 2005, open the solution ''Horde3DEditor_2005.sln'' in ''trunk/Tools/Horde3DEditor''. To build the solution you need to have Qt installed. Since installing the open source version of Qt is not entirely straightforward, here is a quick installation guide for Visual Studio 2005:&lt;br /&gt;
&lt;br /&gt;
# Download the Qt source archive from ftp://ftp.qt.nokia.com/qt/source/qt-all-opensource-src-4.5.2.zip&lt;br /&gt;
# Extract it to a directory '''without any spaces''' (not something like ''C:\Program Files\Qt4'' but rather ''C:\Qt4'')&lt;br /&gt;
# Configure Qt to use wchar_t as built-in type&lt;br /&gt;
## Open ''mkspecs/win32-msvc2005/qmake.conf'' in the Qt directory&lt;br /&gt;
## Find the line ''QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t-'' (around line 19) and remove the last character (the minus)&lt;br /&gt;
# Launch the Visual Studio Command Prompt (can be found in the VS start menu entry under Tools)&lt;br /&gt;
# Change to the Qt source directory&lt;br /&gt;
# Enter ''configure -platform win32-msvc2005 -no-qt3support''&lt;br /&gt;
## ''-no-qt3support'' is not required and is just used to speed up the build process&lt;br /&gt;
## Follow the instructions on the screen and wait until the configuration process is finished&lt;br /&gt;
# Enter ''nmake'' and wait until the build process has finished (can take several hours)&lt;br /&gt;
# Configure environment variables in the Windows Control Panel&lt;br /&gt;
## Add QTDIR which points to your Qt path&lt;br /&gt;
## Add the ''bin'' directory of the Qt path to the PATH variable&lt;br /&gt;
&lt;br /&gt;
If you need more detailed instructions on how to install Qt, please find one of the many tutorials that are available on the net.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Linux &amp;amp; Mac ===&lt;br /&gt;
For the installation under a Linux or MacOS environment you have to install at least&lt;br /&gt;
the Qt development libraries version 4.3.3 or above and CMake 2.8.3 to be able to compile the editor. After checking out the whole community&lt;br /&gt;
svn trunk (svn co http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/), you have to create some temporary build directory and call&lt;br /&gt;
cmake from within that directory with the Tools/Horde3DEditor directory of the community branch checkout as argument.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The first start ==&lt;br /&gt;
After you called the executable, the application starts and will present you&lt;br /&gt;
the Horde3D Scene Editor with an empty window. During the installation two test scenes have been installed to the bin\TestScene &lt;br /&gt;
and bin\Particle folder of the Horde3D Scene Editor installation directory. They contain a&lt;br /&gt;
small scenery to provide you with out-of-the-box examples.&lt;br /&gt;
&lt;br /&gt;
=== Open a scene ===&lt;br /&gt;
To open it click the ﬁle menu and select Open Scene or press CTRL + O as&lt;br /&gt;
a shortcut.&lt;br /&gt;
For the ﬁrst test, browse to the TestScene folder and choose the TestScene.scn&lt;br /&gt;
ﬁle. After you conﬁrmed your selection with the open button the editor will&lt;br /&gt;
load the scene and present it to you.&lt;br /&gt;
&lt;br /&gt;
=== Navigation ===&lt;br /&gt;
There are two possibilities to navigate through the scene. The ﬁrst one is&lt;br /&gt;
similar to most of the today’s ﬁrst person shooters. With the key combination&lt;br /&gt;
W, A, S, D and by clicking with the left mouse button in the viewport widget&lt;br /&gt;
you can move the camera through the scene (note that you have to hold the&lt;br /&gt;
mouse button pressed to rotate the camera). If you would like to use another&lt;br /&gt;
mouse button you can reconﬁgure this in the Settings dialog accessible via&lt;br /&gt;
the File menu.&lt;br /&gt;
&lt;br /&gt;
The second possibility is to use the mouse wheel to navigate forward and&lt;br /&gt;
backward and straﬁng left, right, up, down by holding the CTRL key and&lt;br /&gt;
left mouse button pressed and moving the mouse in the direction to strafe.&lt;br /&gt;
You can change the amount of movement between two frames by changing&lt;br /&gt;
the Navigation Speed entry within the tool bar. Additionally if you keep the&lt;br /&gt;
Shift button pressed the navigation speed will be increased as long as you&lt;br /&gt;
hold it.&lt;br /&gt;
&lt;br /&gt;
A third possibility was introduced with version 0.7.0 if you hold both the&lt;br /&gt;
mouse navigation button (normally the left one) and the select button (by&lt;br /&gt;
default the right one) pressed, you can also strafe along the X- and Y-axis of&lt;br /&gt;
the camera.&lt;br /&gt;
&lt;br /&gt;
The transformation changes to the camera are done only within Horde3D&lt;br /&gt;
and not saved to the XML ﬁle. To change the transformation of a camera&lt;br /&gt;
permanently you have to select it ﬁrst in the scene tree and after you moved &lt;br /&gt;
to the place you want, you have to press the Move Node To Camera Position&lt;br /&gt;
button or activate the corresponding menu entry in the Edit menu (Shortcut:&lt;br /&gt;
CTRL+ALT+C). Now if you press the save button, the transformation of&lt;br /&gt;
the camera will be stored in your scene graph ﬁle.&lt;br /&gt;
&lt;br /&gt;
To get a better impression of the scene you can switch the view to fullscreen&lt;br /&gt;
mode by clicking on the fullscreen button in the toolbar or activate the corresponding &lt;br /&gt;
entry in the View menu. To leave the fullscreen mode you have to press the Escape &lt;br /&gt;
key on your keyboard.&lt;br /&gt;
&lt;br /&gt;
Finally the Wireframe (Debug) Mode button toggles between a debug rendering&lt;br /&gt;
mode and the normal rendering. It is especially useful if you have problems&lt;br /&gt;
with the light and are not sure if a geometry was inserted correctly or not.&lt;br /&gt;
&lt;br /&gt;
For the alignment of objects a parallel projection mode for the cameras has&lt;br /&gt;
been integrated. You can access it using the tool buttons in the camera&lt;br /&gt;
navigation bar. But be aware that the parallel projection might cause&lt;br /&gt;
confusion since the distance of the camera to the objects is only observable&lt;br /&gt;
via the near clipping plane. So if you move the camera position using the W&lt;br /&gt;
or S key, you might get rid of you models because they are clipped by the&lt;br /&gt;
viewing frustum. To zoom when using the parallel projection use the mouse&lt;br /&gt;
wheel.&lt;br /&gt;
&lt;br /&gt;
=== Customizing the editor ===&lt;br /&gt;
For a better workﬂow you can adjust the dock widgets of the editor to your&lt;br /&gt;
personal preferences. To do this just click and drag the titlebar of the dock&lt;br /&gt;
widgets and place them where you want them to be. By default the most&lt;br /&gt;
important dock widgets are visible to you. If you want reduce the required&lt;br /&gt;
screen space there is an option in the Windows menu to toggle the dock&lt;br /&gt;
widget visibility depending on the selected scene graph node. By doing this&lt;br /&gt;
the attachment widget or material widget are hidden if no editor plugin is&lt;br /&gt;
loaded or no node with a material attribute has been selected.&lt;br /&gt;
You can also alter the way mouse buttons are used for camera navigation and&lt;br /&gt;
object selection in the settings dialogue you can access via the Settings entry&lt;br /&gt;
in the ﬁle menu.&lt;br /&gt;
&lt;br /&gt;
=== Manipulating objects ===&lt;br /&gt;
After loading the scene ﬁle, the elements of the scene are listed in the Scene&lt;br /&gt;
Tree. By selecting one of them, the corresponding transformation - stored&lt;br /&gt;
within the XML ﬁle - is shown in the Basic section of the Node Properties&lt;br /&gt;
widget. If you change it, an entry in the Undo section of the Edit menu is&lt;br /&gt;
created, allowing you to undo the change. Depending on the type of node&lt;br /&gt;
you selected, the Node Properties widget shows you additional conﬁguration&lt;br /&gt;
settings. For example if you select a light node you can change the light’s&lt;br /&gt;
color, ﬁeld of view or many other settings. Nodes referencing a material ﬁle&lt;br /&gt;
cause the Material Settings widget to display the content. But take node,&lt;br /&gt;
that the changes you made to the materials can not be undone by using the&lt;br /&gt;
undo/redo commands. Since the materials are separated ﬁles and not direct&lt;br /&gt;
part of the scene graph, you have to save them manually (click on the save&lt;br /&gt;
button) to apply the changes to the scene.&lt;br /&gt;
&lt;br /&gt;
=== Reference Node ===&lt;br /&gt;
A Reference node represents a separate scene graph ﬁle not directly inte-&lt;br /&gt;
grated in the currently shown scene graph tree. To view the content of this&lt;br /&gt;
ﬁle you can double click on the reference element. The scene tree now con-&lt;br /&gt;
tains the contents of this ﬁle and all changes made on the objects are handled&lt;br /&gt;
within the scene graph ﬁle of this element. If you want to switch back to the&lt;br /&gt;
parent scene graph ﬁle you can click on the Arrow at the top of the scene&lt;br /&gt;
tree or press the backspace key. Take note, that all manipulations are done&lt;br /&gt;
in the scene graph currently displayed in the tree view. That’s why you can&lt;br /&gt;
only undo actions done within the currently opened scene graph.&lt;br /&gt;
If you hold the CTRL key pressed, while double clicking on a reference node,&lt;br /&gt;
the camera will be moved to the selected node.&lt;br /&gt;
&lt;br /&gt;
=== Camera Nodes ===&lt;br /&gt;
n a scene you can deﬁne multiple cameras. To activate one of them you&lt;br /&gt;
have to double click on the scene tree item in the tree view or select it in the&lt;br /&gt;
Active Camera combobox of the navigation bar. The active camera can also&lt;br /&gt;
be used to set transformations of other nodes. If you navigate the camera to&lt;br /&gt;
a special point you can adjust the transformation of the currently selected&lt;br /&gt;
node by using the Move Node To Camera Position button or by pressing the&lt;br /&gt;
shortcut: CTRL+ALT+C&lt;br /&gt;
Orthogonal to this you can set the camera transformation to the transformation &lt;br /&gt;
of the currently selected node by using the Move Camera To Node&lt;br /&gt;
button.&lt;br /&gt;
&lt;br /&gt;
== A new scene ==&lt;br /&gt;
Before you create a new scene you may want to conﬁgure an editor repository.&lt;br /&gt;
&lt;br /&gt;
=== Before you start ===&lt;br /&gt;
This will be done in the Settings Dialogue you can ﬁnd under the&lt;br /&gt;
Settings menu entry in the File menu. There are six different repository paths&lt;br /&gt;
to conﬁgure. The ﬁrst is the path to Horde3D pipelines. These ﬁles conﬁgures&lt;br /&gt;
the way Horde3D renders the scene. The next path handles the scene-graph-&lt;br /&gt;
(Extension .scene.xml) and Horde3D geometry ﬁles (Extension .geo). The&lt;br /&gt;
third is the path to the materials directory that contains the subfolders and&lt;br /&gt;
material ﬁles (Extension .material.xml) for the materials of a converted 3d&lt;br /&gt;
model. The texture directory deﬁnes the path where the textures are stored&lt;br /&gt;
while the shaders directory points to the shader (Extension .shader.xml) and&lt;br /&gt;
code ﬁles (Extension .glsl) used by the models stored in the repository. Last&lt;br /&gt;
but not least for effect files (.eﬀect.xml) a separate eﬀect directory can be&lt;br /&gt;
conﬁgured. By default the repository is located in the ''bin\Repository'' folder&lt;br /&gt;
of the Horde3D scene editor and contains the Horde3D samples’ models.&lt;br /&gt;
Next to the repository conﬁguration you can also deﬁne a shader editor in&lt;br /&gt;
the general tab of the settings dialogue. This editor is used when clicking on&lt;br /&gt;
an edit button in the material editor. Other settings are the path to the&lt;br /&gt;
plugin directory used to search for attachment plugins and&lt;br /&gt;
the number of undo steps that will be available. Note that if you choose&lt;br /&gt;
a great number of undo steps or even the Unlimited setting, the Horde3D&lt;br /&gt;
Scene Editor could consume a lot of memory if you make many changes to&lt;br /&gt;
one scene. To prevent this you can manually clean the undo stack just by&lt;br /&gt;
reopen the current scene (every time a scene is closed the undo stack will be&lt;br /&gt;
cleared).&lt;br /&gt;
&lt;br /&gt;
=== Creating a scene ===&lt;br /&gt;
To create a new scene select the New Scene entry in the ﬁle menu or press&lt;br /&gt;
the CTRL + N shortcut. A wizard will appear letting you choose a scene ﬁle&lt;br /&gt;
name and a directory where the newly created scene will be stored. If the&lt;br /&gt;
directory does not exist you will be prompted if you want to create it.&lt;br /&gt;
After choosing the scene directory additional directories for the diﬀerent scene&lt;br /&gt;
resources have to be selected on the next page. As before directories not&lt;br /&gt;
already existing can be created by the editor automatically. Take care that&lt;br /&gt;
the resource directories should be placed below the parent scene directory&lt;br /&gt;
and such should be declared relative to this folder&lt;br /&gt;
&lt;br /&gt;
On the next page you have to conﬁgure a default camera used for rendering.&lt;br /&gt;
While you can keep the default frustum settings, you have to import a ren-&lt;br /&gt;
der pipeline from the repository conﬁgured before. By default some of the&lt;br /&gt;
Horde3D example pipelines are listed when you select Import from repository&lt;br /&gt;
in the combo box. You can then just press the OK Button or adjust the code&lt;br /&gt;
in the edit window. Only the content of this window will be used for the new&lt;br /&gt;
camera. The original ﬁle in the repository remains unchanged.&lt;br /&gt;
&lt;br /&gt;
To allow you viewing the geometry placed in your scene and to conﬁgure a&lt;br /&gt;
light source for the preview of models, you will be asked to deﬁne a default&lt;br /&gt;
light on the next page. The settings you have to make here are depending on&lt;br /&gt;
the pipeline conﬁguration you made on the previous page (see the Horde3D&lt;br /&gt;
documentation for more details). It is important that you conﬁgure this light&lt;br /&gt;
properly since the Material, Lighting Context and Shader Context parameters&lt;br /&gt;
are used for the standard light source in the preview window when adding&lt;br /&gt;
new models to your scene. If your pipeline settings requires the light to have&lt;br /&gt;
a material (e.g. when using deferred rendering), you can import one from&lt;br /&gt;
the repository (see [[#Before_you_start | Before you start]] ). The yellow lock next&lt;br /&gt;
to the ﬁlename indicates that the material will be imported from the model&lt;br /&gt;
data repository you specified before. If you have not specified it properly, or&lt;br /&gt;
do not have a light material, you have to manually copy an appropriate light&lt;br /&gt;
material and shader file to the specific directories of your scene.&lt;br /&gt;
Finally on the last page you can select a plugin for handling Horde3D attachments. &lt;br /&gt;
If there have been plugins found by the editor, the selection box&lt;br /&gt;
let you choose one of them to be the attachment controller for this scene. At&lt;br /&gt;
the moment no public plugin is part of the editor yet.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot; | {{Extension_Summary&lt;br /&gt;
|name = Horde3D Scene Editor&lt;br /&gt;
|screenshot = H3Deditor.jpg&lt;br /&gt;
|description = Tutorial site for the editor.&lt;br /&gt;
|version = 0.8.0&lt;br /&gt;
|horde3dversion = 1.0.0 beta2&lt;br /&gt;
|released = 2008-01-20&lt;br /&gt;
|author = [http://horde3d.org/forums/memberlist.php?mode=viewprofile&amp;amp;u=122 Volker]|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
[[category: Tutorials]]&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Direct_Export_from_Blender&amp;diff=721</id>
		<title>Direct Export from Blender</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Direct_Export_from_Blender&amp;diff=721"/>
				<updated>2012-07-16T10:01:55Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[==== TODO Check compatibility of Blender 2.5 collada tools with ColladaConv and if there are still bugs within Blender's Collada exporter, adjust the Blender Horde direct export for Beta5 compatibility ====]]&lt;br /&gt;
 Small update: Exporting static geometry using Blenders Collada exporter and converting&lt;br /&gt;
 it with the Horde ColladaConverter seems to work.&lt;br /&gt;
 I was not able to successfully export a small animation using keyframes (no bones). - Blender 2.63a, Roland&lt;br /&gt;
&lt;br /&gt;
 New Update: I've ran into some weird problems regarding normals and duplicated geometry&lt;br /&gt;
  and therefore switched back to 3dsMax using Blender's fbx exporter. &lt;br /&gt;
== Exporter ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, Blender's built-in Collada exporter is not fully compatible with Horde's ColladaConverter tool. &lt;br /&gt;
&lt;br /&gt;
A [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/Tools/Exporters/Blender/ new exporter] has been developed in the [[Community Branch | Community SVN Branch]], and can be found at the links below. Currently the exporter does export animations, but only in special configurations.&lt;br /&gt;
&lt;br /&gt;
The new exporter is based on a python script for blender. To use it just save the Horde3DExport.py file to your Blender's '''.blender\scripts''' directory. After that you may have to restart your Blender application.&lt;br /&gt;
&lt;br /&gt;
After restarting Blender there is a new Option ''Horde3D'' in the ''Export'' menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:BlenderExport.jpg]]&lt;br /&gt;
&lt;br /&gt;
If you select this new option, a dialogue window will be opened for choosing the destination of the converted content. &lt;br /&gt;
&lt;br /&gt;
[[Image:BlenderExport2.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Export Filename''' defines the directory and filename used for the model and the geometry file. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Shader''' defines the shader used within the material files used by the exported model.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Relative material path''' will be used for the Horde3D material files. Note that an additional subdirectory for the exported model will be created. It will be named using the base name of the export filename.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Relative animation''' path will be used for any exported animation files&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A '''Texture subdirectory''' can be specified when you want to move all textures used by this model to its own directory within the relative texture path. Otherwise the textures will be copied directly to the texture path (may be useful if you use the same textures in several models&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;All textures used by your model will be copied to the '''Relative texture path'''.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that if you create the scene graph- and geometry file in a subdirectory of your Horde3D Geometry and/or Scene Graph path, the exporter won't recognize that and links the geometry file within the scene graph as if there is no sub directory. That's why the example above will create a cube.scene.xml in the Cube subdirectory that contains a link to a ''cube.geo'' without the additional subdirectory ''cube''.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
&lt;br /&gt;
The exporter supports three types of ''animations'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;''Mesh animations'': They are exported by playing the ''timeline'' from currently setted frame ''start'' to frame ''end'' and - in every frame - writing the transformations of all objects in the *.anim file. You can use keyframes for that.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;''Bone animations'': Work similar to ''mesh animations''. The ''bones'' are exported as ''joints'' to Horde. Because of some problems with the matrices, you should apply scale/rotation to obdata (CTRL+A,1) and set the bone's roll to zero. &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;''Shape keys'': are exported as ''morph targets''. You can find their names in the *.scene.xml as comment. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures and Materials ==&lt;br /&gt;
&lt;br /&gt;
The exporter tries to create the materials in the same way as they exist in blender.&lt;br /&gt;
As there a few differences to horde, you should currently only use one texture per material (except of bump maps). And there should only be one material per object.&lt;br /&gt;
Note: not all shaders support joints and not all shaders support transparency! So you have to choose them carefully. &lt;br /&gt;
&lt;br /&gt;
If you don't want to use textures but static material colors ( Note, no procedural textures! ), you have to use a special shader for them. By default the exporter writes the material color for geometry that don't have textures as a uniform to the material files. If you want to use these uniforms the shader must exactly use this uniform name, currently ''Materialcol''. If you want to use the material color you might try using the [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml materialCol.shader.xml] (an updated version for Beta5 can be found here: [http://www.horde3d.org/forums/download/file.php?id=353]) in place of standard.shader.xml or [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml skinningMatcol.shader.xml] in place of skinning.shader.xml. You can find them in the &lt;br /&gt;
[[Community Branch | Community SVN Branch]]&lt;br /&gt;
To add your exported model to a scene and fine tune your shaders and materials you could use the [[Horde3D Scene Editor | Horde3D Editor]]. &lt;br /&gt;
&lt;br /&gt;
'''If you have experience with Blender and Python and want to help improving the exporter, feel free to post your comments in the [http://horde3d.org/forums/viewtopic.php?f=8&amp;amp;t=362 forum's thread].&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Horde3D 1.0.0 Beta3 ==&lt;br /&gt;
&lt;br /&gt;
Due to our practical course &amp;quot;Spieleprogrammierung&amp;quot; (Game programming) at the Augsburg University we fixed some issues with the Exporter and the new Horde3D Beta 3. Our exporter uses the new shader/texture settings in the *.material.xml and can be found &amp;lt;s&amp;gt;[http://megastore.uni-augsburg.de/get/064A1gmWZg/ here]&amp;lt;/s&amp;gt; &amp;lt;i&amp;gt;Unfortunately the link is dead, maybe someone can adjust the exporter in the community branch to work with Beta4 out of the box&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's only tested with the following settings, others may not work properly:&lt;br /&gt;
&lt;br /&gt;
http://img3.abload.de/img/exportsettingsoc5y.png&lt;br /&gt;
&lt;br /&gt;
''Shader'' is automatically set to ''shaders/model.shader'' and ''F01_Skinning''. For parallax shading, etc. you need to change the *.material.xml.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Direct_Export_from_Blender&amp;diff=720</id>
		<title>Direct Export from Blender</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Direct_Export_from_Blender&amp;diff=720"/>
				<updated>2012-07-14T08:49:25Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[==== TODO Check compatibility of Blender 2.5 collada tools with ColladaConv and if there are still bugs within Blenders Collada exporter, adjust the Blender Horde direct export for Beta5 compatibility ====]]&lt;br /&gt;
 Small update: Exporting static geometry using Blenders Collada exporter and converting it with the Horde ColladaConverter seems to work.&lt;br /&gt;
 I was not able to successfully export a small animation using keyframes (no bones). - Blender 2.63a, Roland&lt;br /&gt;
== Exporter ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, Blender's built-in Collada exporter is not fully compatible with Horde's ColladaConverter tool. &lt;br /&gt;
&lt;br /&gt;
A [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/trunk/Tools/Exporters/Blender/ new exporter] has been developed in the [[Community Branch | Community SVN Branch]], and can be found at the links below. Currently the exporter does export animations, but only in special configurations.&lt;br /&gt;
&lt;br /&gt;
The new exporter is based on a python script for blender. To use it just save the Horde3DExport.py file to your Blender's '''.blender\scripts''' directory. After that you may have to restart your Blender application.&lt;br /&gt;
&lt;br /&gt;
After restarting Blender there is a new Option ''Horde3D'' in the ''Export'' menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:BlenderExport.jpg]]&lt;br /&gt;
&lt;br /&gt;
If you select this new option, a dialogue window will be opened for choosing the destination of the converted content. &lt;br /&gt;
&lt;br /&gt;
[[Image:BlenderExport2.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Export Filename''' defines the directory and filename used for the model and the geometry file. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Shader''' defines the shader used within the material files used by the exported model.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Relative material path''' will be used for the Horde3D material files. Note that an additional subdirectory for the exported model will be created. It will be named using the base name of the export filename.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The '''Relative animation''' path will be used for any exported animation files&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A '''Texture subdirectory''' can be specified when you want to move all textures used by this model to its own directory within the relative texture path. Otherwise the textures will be copied directly to the texture path (may be useful if you use the same textures in several models&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;All textures used by your model will be copied to the '''Relative texture path'''.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that if you create the scene graph- and geometry file in a subdirectory of your Horde3D Geometry and/or Scene Graph path, the exporter won't recognize that and links the geometry file within the scene graph as if there is no sub directory. That's why the example above will create a cube.scene.xml in the Cube subdirectory that contains a link to a ''cube.geo'' without the additional subdirectory ''cube''.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
&lt;br /&gt;
The exporter supports three types of ''animations'':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;''Mesh animations'': They are exported by playing the ''timeline'' from currently setted frame ''start'' to frame ''end'' and - in every frame - writing the transformations of all objects in the *.anim file. You can use keyframes for that.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;''Bone animations'': Work similar to ''mesh animations''. The ''bones'' are exported as ''joints'' to Horde. Because of some problems with the matrices, you should apply scale/rotation to obdata (CTRL+A,1) and set the bone's roll to zero. &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;''Shape keys'': are exported as ''morph targets''. You can find their names in the *.scene.xml as comment. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Textures and Materials ==&lt;br /&gt;
&lt;br /&gt;
The exporter tries to create the materials in the same way as they exist in blender.&lt;br /&gt;
As there a few differences to horde, you should currently only use one texture per material (except of bump maps). And there should only be one material per object.&lt;br /&gt;
Note: not all shaders support joints and not all shaders support transparency! So you have to choose them carefully. &lt;br /&gt;
&lt;br /&gt;
If you don't want to use textures but static material colors ( Note, no procedural textures! ), you have to use a special shader for them. By default the exporter writes the material color for geometry that don't have textures as a uniform to the material files. If you want to use these uniforms the shader must exactly use this uniform name, currently ''Materialcol''. If you want to use the material color you might try using the [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml materialCol.shader.xml] (an updated version for Beta5 can be found here: [http://www.horde3d.org/forums/download/file.php?id=353]) in place of standard.shader.xml or [http://mm-werkstatt.informatik.uni-augsburg.de/public/Horde3D/assets/Horde3D/shaders/materialCol.shader.xml skinningMatcol.shader.xml] in place of skinning.shader.xml. You can find them in the &lt;br /&gt;
[[Community Branch | Community SVN Branch]]&lt;br /&gt;
To add your exported model to a scene and fine tune your shaders and materials you could use the [[Horde3D Scene Editor | Horde3D Editor]]. &lt;br /&gt;
&lt;br /&gt;
'''If you have experience with Blender and Python and want to help improving the exporter, feel free to post your comments in the [http://horde3d.org/forums/viewtopic.php?f=8&amp;amp;t=362 forum's thread].&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
== Horde3D 1.0.0 Beta3 ==&lt;br /&gt;
&lt;br /&gt;
Due to our practical course &amp;quot;Spieleprogrammierung&amp;quot; (Game programming) at the Augsburg University we fixed some issues with the Exporter and the new Horde3D Beta 3. Our exporter uses the new shader/texture settings in the *.material.xml and can be found &amp;lt;s&amp;gt;[http://megastore.uni-augsburg.de/get/064A1gmWZg/ here]&amp;lt;/s&amp;gt; &amp;lt;i&amp;gt;Unfortunately the link is dead, maybe someone can adjust the exporter in the community branch to work with Beta4 out of the box&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's only tested with the following settings, others may not work properly:&lt;br /&gt;
&lt;br /&gt;
http://img3.abload.de/img/exportsettingsoc5y.png&lt;br /&gt;
&lt;br /&gt;
''Shader'' is automatically set to ''shaders/model.shader'' and ''F01_Skinning''. For parallax shading, etc. you need to change the *.material.xml.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=717</id>
		<title>Horde3D Wiki:Community portal</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:Community_portal&amp;diff=717"/>
				<updated>2012-05-01T14:26:56Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: Added link to shader syntax highlighting scheme&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__ __NOTOC__{{ContentBlock|color=orange&lt;br /&gt;
|content= '''The community portal section of the Horde3D wiki contains community contributed articles that are not part of the official documentation. Feel free to add articles to our wiki or links to external tutorials.'''}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
{{ContentBlock|&lt;br /&gt;
|header=Information, instructions and tips on using Horde3D&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
==Programming Guide==&lt;br /&gt;
=== Build Instructions ===&lt;br /&gt;
#[[Building Horde3D]] - Instructions for obtaining the code and building Horde on all supported platforms&lt;br /&gt;
&lt;br /&gt;
[[Category: Tutorials]]&lt;br /&gt;
&lt;br /&gt;
===Beginner Tutorials===&lt;br /&gt;
#[[Tutorial - Hello World]] - In this section we will create a simple application that loads a character and animates it using a walk cycle.&lt;br /&gt;
#[[Tutorial - Picking]] - In this section we will demonstrate picking the node under the mouse cursor&lt;br /&gt;
#[[Tutorial - Simple HUD]] - How to use showOverlay to create a simple HUD.&lt;br /&gt;
#[[Tutorial - Setup Horde with SDL]]   - How to Setup Horde with SDL.&lt;br /&gt;
#[[Tutorial - Setup Horde with Qt4]]   - How to Setup Horde with Qt4.&lt;br /&gt;
#[[Tutorial - Setup Horde with Gtkmm]] - How to Setup Horde with Gtkmm&lt;br /&gt;
#[[Tutorial - Setup Horde with SFML]] - How to Setup Horde with SFML&lt;br /&gt;
#[[Tutorial - Stereo rendering]] - Basic outline for quad-buffered stereo rendering&lt;br /&gt;
&lt;br /&gt;
===Advanced Tutorials===&lt;br /&gt;
#[[Basic Pipeline Tutorial]] - Create your first custom pipeline.&lt;br /&gt;
#[[Procedurally generated geometry tutorial]] - How to create Horde3D compatible procedural geometry (Horde3D 1.0.0 '''Beta 3''' only!).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shader Development==&lt;br /&gt;
[[Category: Techniques]]&lt;br /&gt;
===General===&lt;br /&gt;
#A syntax highlighting scheme for Notepad++ which works with Horde3D shader files can be found [http://www.horde3d.org/forums/viewtopic.php?f=5&amp;amp;t=697 here].&lt;br /&gt;
&lt;br /&gt;
===Debugging and Profiling===&lt;br /&gt;
#[[Using GPU PerfStudio]] - Quick steps to get started with GPU PerfStudio&lt;br /&gt;
&lt;br /&gt;
===Render System Basics===&lt;br /&gt;
#[[The Flexible Rendering Pipeline]] - Introduction to Horde's data-driven rendering pipelines&lt;br /&gt;
&lt;br /&gt;
===Rendering Quality===&lt;br /&gt;
#[[Gamma Correction]] - Overview of gamma correction and how to apply it with Horde&lt;br /&gt;
&lt;br /&gt;
===Shading===&lt;br /&gt;
#[[Shading Technique - Dot Product Detail Texturing]] - Using the dot product of vectors and signed textures for high frequency detail&lt;br /&gt;
#[[Shading Technique - Palette Coloring]] - Quick and dirty palette recoloration of objects&lt;br /&gt;
#[[Shading Technique - Gloss Mapping]] - Mask which areas of an object have specular highlights&lt;br /&gt;
#[[Shading Technique - Glow Mapping]] - Allow areas on an object to emit a strong glowing highlight&lt;br /&gt;
#[[Shading Technique - Fresnel]] - Using reflection and refraction&lt;br /&gt;
#[[Shading Technique - Linear Depth Buffer]] - Create a custom linear depth buffer using vertex&lt;br /&gt;
#[[Shading Technique - Terrain Shading]] - Height and slope based shading with triplanar texturing&lt;br /&gt;
&lt;br /&gt;
===Preprocessing===&lt;br /&gt;
#[[Preprocessing Technique - Distance Field Vector Textures]] - Using Adobe Photoshop to generate textures suitable for efficient vector art rendering&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Asset Creation==&lt;br /&gt;
&lt;br /&gt;
[[Category: Content Import]]&lt;br /&gt;
#[[DCC Tool Support]] - List of supported Digital Content Creation Tools&lt;br /&gt;
#[[AssetTroubleshooting|Troubleshooting]] - ''&amp;quot;Help, my model is not showing up!&amp;quot;''&lt;br /&gt;
#[[Tips and Techniques]] - Asset creation suggestions &amp;amp; ideas for Horde3d, exporting and program quirks..&lt;br /&gt;
#[[Extending ColladaConv]] - Add support for exporting cameras&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=DCC_Tool_Support&amp;diff=705</id>
		<title>DCC Tool Support</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=DCC_Tool_Support&amp;diff=705"/>
				<updated>2011-10-25T13:44:20Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__{{ContentBlock|color=white|content={{!!}}&lt;br /&gt;
== Textures ==&lt;br /&gt;
&lt;br /&gt;
Horde3D can load textures from standard image formats (TGA, JPEG, PNG, BMP, PSD, HDR), so virtually any image editing software can be used to create textures. Note however, that some more exotic features of these formats like progressive JPEGs are not supported.&lt;br /&gt;
&lt;br /&gt;
Besides the mentioned formats, Horde3D can directly load DDS (Direct Draw Surface) textures. DDS files can store less common texture types like cube maps or volume textures. They can also store data in a DXT compressed format which is understood directly by the graphics hardware. Since no decompression is required, loading DDS files is usually much more efficient than loading compressed JPEG or PNG images.&lt;br /&gt;
&lt;br /&gt;
The following tools are especially useful for creating DDS files:&lt;br /&gt;
&lt;br /&gt;
* [http://developer.nvidia.com/object/nv_texture_tools.html NVidia Texture Tools]&lt;br /&gt;
* [http://developer.amd.com/gpu/cubemapgen/pages/default.aspx ATI CubeMapGen]&lt;br /&gt;
* [http://msdn.microsoft.com/en-us/library/ee417856%28VS.85%29.aspx DxTex.exe (in DirectX SDK)]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Models and Animations ==&lt;br /&gt;
&lt;br /&gt;
Horde3D uses Collada as source format for 3d assets, so it supports a wide range of modeling applications. However, since Collada is a complex format which provides several ways to store the same data, the Collada output that a DCC tool produces may have some slight incompatibility with Horde's ColladaConv. Luckily, these problems are usually easy to fix and in fact the range of supported applications has already increased a lot over time. If you have a Collada file that is not working with Horde, feel free to give a shout in the forums.&lt;br /&gt;
&lt;br /&gt;
=== Collada Compatibility===&lt;br /&gt;
&lt;br /&gt;
* '''3D Studio Max 2009 and older'''&lt;br /&gt;
** Recommended exporter: [http://sourceforge.net/projects/colladamaya/ Feeling Software ColladaMax]&lt;br /&gt;
** Notes:&lt;br /&gt;
*** Very well tested. Full support for static and skinned meshes with animations and morph targets.&lt;br /&gt;
*** Always enable '''animation sampling''' and '''triangulation''' in the export options.&lt;br /&gt;
* '''3D Studio Max 2010 and newer'''&lt;br /&gt;
** The included Autodesk Collada Exporter works for static and skinned meshes using biped, cat-rigs, and bones. Make sure to use the latest FBX Plug-in version (latest testet version using 3DsMax 2011 is plug-in version 2012.2). &lt;br /&gt;
*** Successfully used exporter settings can be found [http://imageshack.us/f/718/autodeskcolladaexporter.png/ here].&lt;br /&gt;
**  The [http://code.google.com/p/opencollada/downloads/list OpenCOLLADA exporter] version 1.3.1 was successfully used to export static and skinned meshes which included morphtargets on top of the skinned geometry. Small problems occurring in the morphtarget naming scheme can be solved by editing the .dea file in a texteditor.&lt;br /&gt;
*** Successfully used exporter settings can be found [http://imageshack.us/photo/my-images/508/opencollada.png/ here].&lt;br /&gt;
* '''Maya'''&lt;br /&gt;
** Recommended exporter: [http://sourceforge.net/projects/colladamaya/ Feeling Software ColladaMaya]&lt;br /&gt;
** Notes:&lt;br /&gt;
***  ColladaMaya uses the same code base as ColladaMax (FCollada), so the support should be good as well.&lt;br /&gt;
* '''Modo'''&lt;br /&gt;
** See [[Collada_-_Modo]]&lt;br /&gt;
&lt;br /&gt;
''The list above is not complete. The Collada output of many more DCC applications is supported, however someone actually working with them should please add reliable information about the level of support.''&lt;br /&gt;
&lt;br /&gt;
=== Special Exporters and Converters ===&lt;br /&gt;
&lt;br /&gt;
In general, using Collada should be preferred over having custom exporters. The reason for this is that ColladaConv does a fair amount of data conditioning and optimization which would have to be implemented for each exporter individually. However, some modeling tools don't have proper Collada export, so custom tools are required for them.&lt;br /&gt;
&lt;br /&gt;
==== Blender Exporter ====&lt;br /&gt;
&lt;br /&gt;
Blender has basic support for exporting Collada but skinning and animations are not working properly. For that reason, a direct [[Direct Export from Blender|Exporter for Horde3D]] is available.&lt;br /&gt;
&lt;br /&gt;
==== AC3D Converter ====&lt;br /&gt;
&lt;br /&gt;
jimbo has written a converter to bring AC3D .ac files to the Horde3D format. The converter with full source code can be downloaded from [http://www.daansystems.com/ac3d2horde3d here].&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=680</id>
		<title>Horde3D Wiki:HOWTO</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=680"/>
				<updated>2010-08-13T21:03:30Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|color=white|content={{!!}}&lt;br /&gt;
The HOWTO contains quick answers for smaller problems. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to enable anti-aliasing (MSAA) ==&lt;br /&gt;
&lt;br /&gt;
Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute '''maxSamples''' which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option '''SampleCount'''. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get the size of a loaded texture ==&lt;br /&gt;
&lt;br /&gt;
The following code queries the dimensions of the base mipmap of a loaded texture:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int width = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgWidthI );&lt;br /&gt;
int height = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgHeightI );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
If you want to get the dimensions of mipmap level ''n'', change the elemIdx parameter which is 0 above to ''n''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to procedurally generate a texture ==&lt;br /&gt;
&lt;br /&gt;
To generate a texture and bind it to a shader, you need to perform three steps:&lt;br /&gt;
&lt;br /&gt;
First, create the texture handle, map data stream and write to it. Note that you need to perform this step '''before''' loading resources from disk (using &amp;lt;code&amp;gt;H3dutLoadResourcesFromDisk()&amp;lt;/code&amp;gt;)! Otherwise, the texture creation will fail.&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes texRes = h3dCreateTexture( &amp;quot;myTexRes&amp;quot;, 64, 64, H3DFormats::TEX_RGBA16F, H3DResFlags::NoTexMipmaps );&lt;br /&gt;
float *data = static_cast&amp;lt;float*&amp;gt;( h3dMapResStream( texRes, H3DTexRes::ImageElem, 0, H3DTexRes::ImgPixelStream, false, true ) );&lt;br /&gt;
for( int row=0; row&amp;lt;64; ++row )&lt;br /&gt;
{&lt;br /&gt;
    float *rowPtr = data + row*64*4;&lt;br /&gt;
    for( int col=0; col&amp;lt;64; ++col )&lt;br /&gt;
    {&lt;br /&gt;
        float *sample = rowPtr + col*4;&lt;br /&gt;
        sample[0] = ...; // R&lt;br /&gt;
        sample[1] = ...; // G&lt;br /&gt;
        sample[2] = ...; // B&lt;br /&gt;
        sample[3] = ...; // A&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
h3dUnmapResStream( texRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Second, to bind the texture to a shader, you need to include it in the material XML file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Material&amp;gt;&lt;br /&gt;
    &amp;lt;Shader source=&amp;quot;shaders/myshader.shader&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Sampler name=&amp;quot;myTexture&amp;quot; map=&amp;quot;myTexRes&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Material&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to reference the sampler in the shader, you need to declare it like this:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= Shader Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
[[FX]]&lt;br /&gt;
sampler myTexture;&lt;br /&gt;
&lt;br /&gt;
// ... declare other samplers, contexts etc.&lt;br /&gt;
&lt;br /&gt;
[[FS_LIGHTING]]&lt;br /&gt;
&lt;br /&gt;
varying vec2 texCoords; // ... assumed given by vertex shader ...&lt;br /&gt;
uniform sampler2D myTexture;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
  gl_FragColor = texture2D( myTexture, texCoords );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
Information taken from [http://www.horde3d.org/forums/viewtopic.php?f=2&amp;amp;t=965 this thread] on the forums.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to modify vertex data ==&lt;br /&gt;
&lt;br /&gt;
Vertex data is stored as streams in geometry resources. A pointer to the vertex data can be obtained by mapping a stream. The following code modifies the y coordinates of all vertex positions stored in the specified geometry resource.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int vertCount = h3dGetResParamI( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertexCountI );&lt;br /&gt;
float *pVertPosData = (float *)h3dMapResStream( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertPosStream, true, true );&lt;br /&gt;
&lt;br /&gt;
for( int i = 0; i &amp;lt; vertCount; ++i )&lt;br /&gt;
{&lt;br /&gt;
    pVertPosData[i * 3 + 1] = pVertPosData[i * 3 + 1] * 2;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h3dUnmapResStream( myGeoRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to exchange a texture of a mesh ==&lt;br /&gt;
&lt;br /&gt;
Consider you want to exchange the diffuse texture (sampler named ''albedoMap'') of a given mesh (with node handle ''myMesh'') by a texture resource with resource handle ''myNewTex''. You can do that with the following code:&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes matRes = h3dGetNodeParamI( myMesh, H3DMesh::MatResI );&lt;br /&gt;
int idx = h3dFindResElem( matRes, H3DMatRes::SamplerElem, H3DMatRes::SampNameStr, &amp;quot;albedoMap&amp;quot; );&lt;br /&gt;
h3dSetResParamI( matRes, H3DMatRes::SamplerElem, idx, H3DMatRes::SampTexResI, myNewTex );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
First you need to retrieve the material used by the mesh. After that, you can find the desired sampler in the material. Finally, once you have the sampler index, you can access the sampler data and override its texture resource.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The code above changes directly the material resource. If several meshes are using the same material, all of them will have the new texture. If that is not desired, you can create a private copy of the material by cloning it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to display text in the scene ==&lt;br /&gt;
&lt;br /&gt;
Usually, text is displayed as part of a GUI or HUD on top of the scene. However, sometimes it can be useful to display text inside the scene at the location of a specific node. The following snippet displays the names of all models at the nodes' origins. For obtaining the right screen position, the node positions are projected and converted to overlay coordinates.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= C++ Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Get camera view matrix&lt;br /&gt;
const float *camTrans;&lt;br /&gt;
h3dGetNodeTransMats( _cam, 0x0, &amp;amp;camTrans );&lt;br /&gt;
Matrix4f viewMat( Matrix4f( camTrans ).inverted() );&lt;br /&gt;
&lt;br /&gt;
// Get camera projection matrix&lt;br /&gt;
float camProj[16];&lt;br /&gt;
h3dGetCameraProjMat( _cam, camProj );&lt;br /&gt;
Matrix4f projMat( camProj );&lt;br /&gt;
&lt;br /&gt;
// Loop over all model nodes&lt;br /&gt;
int cnt = h3dFindNodes( H3DRootNode, &amp;quot;&amp;quot;, H3DNodeTypes::Model );&lt;br /&gt;
for( int i = 0; i &amp;lt; cnt; ++i )&lt;br /&gt;
{&lt;br /&gt;
	// Get node name&lt;br /&gt;
	H3DNode node = h3dGetNodeFindResult( i );&lt;br /&gt;
	const char *name = h3dGetNodeParamStr( node, H3DNodeParams::NameStr );&lt;br /&gt;
&lt;br /&gt;
	// Get node position&lt;br /&gt;
	const float *nodeTrans;&lt;br /&gt;
	h3dGetNodeTransMats( node, 0, &amp;amp;nodeTrans ); &lt;br /&gt;
	Vec4f pos( nodeTrans[12], nodeTrans[13], nodeTrans[14], 1 );&lt;br /&gt;
&lt;br /&gt;
	// Project&lt;br /&gt;
	pos = projMat * viewMat * pos;&lt;br /&gt;
	float x = pos.x / pos.w;&lt;br /&gt;
	float y = pos.y / pos.w;&lt;br /&gt;
&lt;br /&gt;
	// Transform to overlay coordinates&lt;br /&gt;
    const float aspectRatio = h3dGetViewportParams( 0x0, 0x0, 0x0, 0x0 );&lt;br /&gt;
	x = (x * 0.5f + 0.5f)*aspectRatio;&lt;br /&gt;
	y = -y * 0.5f + 0.5f;&lt;br /&gt;
&lt;br /&gt;
	// Show text (avoid back-projection)&lt;br /&gt;
	if( pos.w &amp;gt; 0 ) h3dutShowText( name, x, y, 0.02f, 1.0f, 1.0f, 1.0f, _fontMatRes);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to tell the camera to look at a point ==&lt;br /&gt;
&lt;br /&gt;
Only pseudo code here, how the math behind this works can be found by searching for gluLookAt.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
forward = targetPosition - cameraPosition&lt;br /&gt;
forward = normalize(forward)&lt;br /&gt;
&lt;br /&gt;
up = Vector3(0, 1, 0) # vector pointing &amp;quot;up&amp;quot;, can be almost any vector&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
right = cross(forward, up)&lt;br /&gt;
right = normalize(right)&lt;br /&gt;
&lt;br /&gt;
up = cross(right, forward)&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
# rotation matrix, column major format&lt;br /&gt;
m1 = [right.x, up.x, -forward.x, 0,&lt;br /&gt;
    right.y, up.y, -forward.y, 0,&lt;br /&gt;
    right.z, up.z, -forward.z, 0,&lt;br /&gt;
    0, 0, 0, 1]&lt;br /&gt;
&lt;br /&gt;
# translation matrix, column major format&lt;br /&gt;
m2 = [1, 0, 0, 0,&lt;br /&gt;
    0, 1, 0, 0,&lt;br /&gt;
    0, 0, 1, 0,&lt;br /&gt;
    -cameraPosition.x, -cameraPosition.y, -cameraPosition.z, 1]&lt;br /&gt;
&lt;br /&gt;
# combined transformation matrix (&amp;quot;view&amp;quot; matrix)&lt;br /&gt;
m3 = m1 * m2&lt;br /&gt;
&lt;br /&gt;
# since the camera node is just another node in Horde3D we have to invert the matrix m3&lt;br /&gt;
m3 = invert(m3)&lt;br /&gt;
&lt;br /&gt;
h3dSetNodeTransMat(cameraNode, m3)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
This example will fail when either forward is a zero vector or forward is parallel to the choosen up vector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to orbit / rotate the camera around a point ==&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# setup: create an anchor node, so that the camera can always rotate around a relative (0, 0, 0) point&lt;br /&gt;
anchorNode = h3dAddGroupNode(h3dRootNode, 'camera-anchor')&lt;br /&gt;
cameraNode = h3dAddCameraNode(anchorNode, 'camera-orbiter')&lt;br /&gt;
&lt;br /&gt;
# basically calculate point on the surface of a sphere&lt;br /&gt;
# by using distance and two angles&lt;br /&gt;
&lt;br /&gt;
phi = phi % 360.0&lt;br /&gt;
theta = theta % 360.0&lt;br /&gt;
&lt;br /&gt;
if phi &amp;lt; 0: # will break for phi=0 and theta=0 otherwise&lt;br /&gt;
    phi = 0.0001&lt;br /&gt;
&lt;br /&gt;
r = distance&lt;br /&gt;
p = radians(phi)&lt;br /&gt;
t = radians(theta)&lt;br /&gt;
&lt;br /&gt;
x = r * cos(t) * sin(p)&lt;br /&gt;
y = r * cos(p)&lt;br /&gt;
z = r * sin(t) * sin(p)&lt;br /&gt;
&lt;br /&gt;
# calculate vectors for camera look at&lt;br /&gt;
forward = Vector3(0, 0, 0,) - Vector3(x, y, z)&lt;br /&gt;
if phi &amp;gt;= 180.0:&lt;br /&gt;
    up = Vector3(0, 1, 0)&lt;br /&gt;
else:&lt;br /&gt;
    up = Vector3(0, -1, 0)&lt;br /&gt;
&lt;br /&gt;
# with the forward and up vector use the code from the look at example to point the camera at the point (0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
When following another scene node use that node instead of h3dRootNode as a parent in the h3dAddGroupNode call.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=679</id>
		<title>Horde3D Wiki:HOWTO</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=679"/>
				<updated>2010-08-13T21:01:15Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: Changed &amp;quot;How to display text in the scene&amp;quot; considering the new h3dutShowText() and ViewportParams&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|color=white|content={{!!}}&lt;br /&gt;
The HOWTO contains quick answers for smaller problems. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to enable anti-aliasing (MSAA) ==&lt;br /&gt;
&lt;br /&gt;
Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute '''maxSamples''' which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option '''SampleCount'''. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get the size of a loaded texture ==&lt;br /&gt;
&lt;br /&gt;
The following code queries the dimensions of the base mipmap of a loaded texture:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int width = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgWidthI );&lt;br /&gt;
int height = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgHeightI );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
If you want to get the dimensions of mipmap level ''n'', change the elemIdx parameter which is 0 above to ''n''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to procedurally generate a texture ==&lt;br /&gt;
&lt;br /&gt;
To generate a texture and bind it to a shader, you need to perform three steps:&lt;br /&gt;
&lt;br /&gt;
First, create the texture handle, map data stream and write to it. Note that you need to perform this step '''before''' loading resources from disk (using &amp;lt;code&amp;gt;H3dutLoadResourcesFromDisk()&amp;lt;/code&amp;gt;)! Otherwise, the texture creation will fail.&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes texRes = h3dCreateTexture( &amp;quot;myTexRes&amp;quot;, 64, 64, H3DFormats::TEX_RGBA16F, H3DResFlags::NoTexMipmaps );&lt;br /&gt;
float *data = static_cast&amp;lt;float*&amp;gt;( h3dMapResStream( texRes, H3DTexRes::ImageElem, 0, H3DTexRes::ImgPixelStream, false, true ) );&lt;br /&gt;
for( int row=0; row&amp;lt;64; ++row )&lt;br /&gt;
{&lt;br /&gt;
    float *rowPtr = data + row*64*4;&lt;br /&gt;
    for( int col=0; col&amp;lt;64; ++col )&lt;br /&gt;
    {&lt;br /&gt;
        float *sample = rowPtr + col*4;&lt;br /&gt;
        sample[0] = ...; // R&lt;br /&gt;
        sample[1] = ...; // G&lt;br /&gt;
        sample[2] = ...; // B&lt;br /&gt;
        sample[3] = ...; // A&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
h3dUnmapResStream( texRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Second, to bind the texture to a shader, you need to include it in the material XML file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Material&amp;gt;&lt;br /&gt;
    &amp;lt;Shader source=&amp;quot;shaders/myshader.shader&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Sampler name=&amp;quot;myTexture&amp;quot; map=&amp;quot;myTexRes&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Material&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to reference the sampler in the shader, you need to declare it like this:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= Shader Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
[[FX]]&lt;br /&gt;
sampler myTexture;&lt;br /&gt;
&lt;br /&gt;
// ... declare other samplers, contexts etc.&lt;br /&gt;
&lt;br /&gt;
[[FS_LIGHTING]]&lt;br /&gt;
&lt;br /&gt;
varying vec2 texCoords; // ... assumed given by vertex shader ...&lt;br /&gt;
uniform sampler2D myTexture;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
  gl_FragColor = texture2D( myTexture, texCoords );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
Information taken from [http://www.horde3d.org/forums/viewtopic.php?f=2&amp;amp;t=965 this thread] on the forums.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to modify vertex data ==&lt;br /&gt;
&lt;br /&gt;
Vertex data is stored as streams in geometry resources. A pointer to the vertex data can be obtained by mapping a stream. The following code modifies the y coordinates of all vertex positions stored in the specified geometry resource.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int vertCount = h3dGetResParamI( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertexCountI );&lt;br /&gt;
float *pVertPosData = (float *)h3dMapResStream( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertPosStream, true, true );&lt;br /&gt;
&lt;br /&gt;
for( int i = 0; i &amp;lt; vertCount; ++i )&lt;br /&gt;
{&lt;br /&gt;
    pVertPosData[i * 3 + 1] = pVertPosData[i * 3 + 1] * 2;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h3dUnmapResStream( myGeoRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to exchange a texture of a mesh ==&lt;br /&gt;
&lt;br /&gt;
Consider you want to exchange the diffuse texture (sampler named ''albedoMap'') of a given mesh (with node handle ''myMesh'') by a texture resource with resource handle ''myNewTex''. You can do that with the following code:&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes matRes = h3dGetNodeParamI( myMesh, H3DMesh::MatResI );&lt;br /&gt;
int idx = h3dFindResElem( matRes, H3DMatRes::SamplerElem, H3DMatRes::SampNameStr, &amp;quot;albedoMap&amp;quot; );&lt;br /&gt;
h3dSetResParamI( matRes, H3DMatRes::SamplerElem, idx, H3DMatRes::SampTexResI, myNewTex );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
First you need to retrieve the material used by the mesh. After that, you can find the desired sampler in the material. Finally, once you have the sampler index, you can access the sampler data and override its texture resource.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The code above changes directly the material resource. If several meshes are using the same material, all of them will have the new texture. If that is not desired, you can create a private copy of the material by cloning it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to display text in the scene ==&lt;br /&gt;
&lt;br /&gt;
Usually, text is displayed as part of a GUI or HUD on top of the scene. However, sometimes it can be useful to display text inside the scene at the location of a specific node. The following snippet displays the names of all models at the nodes' origins. For obtaining the right screen position, the node positions are projected and converted to overlay coordinates.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= C++ Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Get camera view matrix&lt;br /&gt;
const float *camTrans;&lt;br /&gt;
h3dGetNodeTransMats( _cam, 0x0, &amp;amp;camTrans );&lt;br /&gt;
Matrix4f viewMat( Matrix4f( camTrans ).inverted() );&lt;br /&gt;
&lt;br /&gt;
// Get camera projection matrix&lt;br /&gt;
float camProj[16];&lt;br /&gt;
h3dGetCameraProjMat( _cam, camProj );&lt;br /&gt;
Matrix4f projMat( camProj );&lt;br /&gt;
&lt;br /&gt;
// Loop over all model nodes&lt;br /&gt;
int cnt = h3dFindNodes( H3DRootNode, &amp;quot;&amp;quot;, H3DNodeTypes::Model );&lt;br /&gt;
for( int i = 0; i &amp;lt; cnt; ++i )&lt;br /&gt;
{&lt;br /&gt;
	// Get node name&lt;br /&gt;
	H3DNode node = h3dGetNodeFindResult( i );&lt;br /&gt;
	const char *name = h3dGetNodeParamStr( node, H3DNodeParams::NameStr );&lt;br /&gt;
&lt;br /&gt;
	// Get node position&lt;br /&gt;
	const float *nodeTrans;&lt;br /&gt;
	h3dGetNodeTransMats( node, 0, &amp;amp;nodeTrans ); &lt;br /&gt;
	Vec4f pos( nodeTrans[12], nodeTrans[13], nodeTrans[14], 1 );&lt;br /&gt;
&lt;br /&gt;
	// Project&lt;br /&gt;
	pos = projMat * viewMat * pos;&lt;br /&gt;
	float x = pos.x / pos.w;&lt;br /&gt;
	float y = pos.y / pos.w;&lt;br /&gt;
&lt;br /&gt;
	// Transform to overlay coordinates&lt;br /&gt;
        const float aspectRatio = h3dGetViewportParams( 0x0, 0x0, 0x0, 0x0 );&lt;br /&gt;
	x = (x * 0.5f + 0.5f)*aspectRatio;&lt;br /&gt;
	y = -y * 0.5f + 0.5f;&lt;br /&gt;
&lt;br /&gt;
	// Show text (avoid back-projection)&lt;br /&gt;
	if( pos.w &amp;gt; 0 ) h3dutShowText( name, x, y, 0.02f, 1.0f, 1.0f, 1.0f, _fontMatRes);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to tell the camera to look at a point ==&lt;br /&gt;
&lt;br /&gt;
Only pseudo code here, how the math behind this works can be found by searching for gluLookAt.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
forward = targetPosition - cameraPosition&lt;br /&gt;
forward = normalize(forward)&lt;br /&gt;
&lt;br /&gt;
up = Vector3(0, 1, 0) # vector pointing &amp;quot;up&amp;quot;, can be almost any vector&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
right = cross(forward, up)&lt;br /&gt;
right = normalize(right)&lt;br /&gt;
&lt;br /&gt;
up = cross(right, forward)&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
# rotation matrix, column major format&lt;br /&gt;
m1 = [right.x, up.x, -forward.x, 0,&lt;br /&gt;
    right.y, up.y, -forward.y, 0,&lt;br /&gt;
    right.z, up.z, -forward.z, 0,&lt;br /&gt;
    0, 0, 0, 1]&lt;br /&gt;
&lt;br /&gt;
# translation matrix, column major format&lt;br /&gt;
m2 = [1, 0, 0, 0,&lt;br /&gt;
    0, 1, 0, 0,&lt;br /&gt;
    0, 0, 1, 0,&lt;br /&gt;
    -cameraPosition.x, -cameraPosition.y, -cameraPosition.z, 1]&lt;br /&gt;
&lt;br /&gt;
# combined transformation matrix (&amp;quot;view&amp;quot; matrix)&lt;br /&gt;
m3 = m1 * m2&lt;br /&gt;
&lt;br /&gt;
# since the camera node is just another node in Horde3D we have to invert the matrix m3&lt;br /&gt;
m3 = invert(m3)&lt;br /&gt;
&lt;br /&gt;
h3dSetNodeTransMat(cameraNode, m3)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
This example will fail when either forward is a zero vector or forward is parallel to the choosen up vector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to orbit / rotate the camera around a point ==&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# setup: create an anchor node, so that the camera can always rotate around a relative (0, 0, 0) point&lt;br /&gt;
anchorNode = h3dAddGroupNode(h3dRootNode, 'camera-anchor')&lt;br /&gt;
cameraNode = h3dAddCameraNode(anchorNode, 'camera-orbiter')&lt;br /&gt;
&lt;br /&gt;
# basically calculate point on the surface of a sphere&lt;br /&gt;
# by using distance and two angles&lt;br /&gt;
&lt;br /&gt;
phi = phi % 360.0&lt;br /&gt;
theta = theta % 360.0&lt;br /&gt;
&lt;br /&gt;
if phi &amp;lt; 0: # will break for phi=0 and theta=0 otherwise&lt;br /&gt;
    phi = 0.0001&lt;br /&gt;
&lt;br /&gt;
r = distance&lt;br /&gt;
p = radians(phi)&lt;br /&gt;
t = radians(theta)&lt;br /&gt;
&lt;br /&gt;
x = r * cos(t) * sin(p)&lt;br /&gt;
y = r * cos(p)&lt;br /&gt;
z = r * sin(t) * sin(p)&lt;br /&gt;
&lt;br /&gt;
# calculate vectors for camera look at&lt;br /&gt;
forward = Vector3(0, 0, 0,) - Vector3(x, y, z)&lt;br /&gt;
if phi &amp;gt;= 180.0:&lt;br /&gt;
    up = Vector3(0, 1, 0)&lt;br /&gt;
else:&lt;br /&gt;
    up = Vector3(0, -1, 0)&lt;br /&gt;
&lt;br /&gt;
# with the forward and up vector use the code from the look at example to point the camera at the point (0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
When following another scene node use that node instead of h3dRootNode as a parent in the h3dAddGroupNode call.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=678</id>
		<title>Horde3D Wiki:HOWTO</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=678"/>
				<updated>2010-08-12T08:22:51Z</updated>
		
		<summary type="html">&lt;p&gt;Roland: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__{{ContentBlock|color=white|content={{!!}}&lt;br /&gt;
The HOWTO contains quick answers for smaller problems. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to enable anti-aliasing (MSAA) ==&lt;br /&gt;
&lt;br /&gt;
Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute '''maxSamples''' which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option '''SampleCount'''. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to get the size of a loaded texture ==&lt;br /&gt;
&lt;br /&gt;
The following code queries the dimensions of the base mipmap of a loaded texture:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int width = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgWidthI );&lt;br /&gt;
int height = h3dGetResParamI( texResHandle, H3DTexRes::ImageElem, 0, H3DTexRes::ImgHeightI );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
If you want to get the dimensions of mipmap level ''n'', change the elemIdx parameter which is 0 above to ''n''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to procedurally generate a texture ==&lt;br /&gt;
&lt;br /&gt;
To generate a texture and bind it to a shader, you need to perform three steps:&lt;br /&gt;
&lt;br /&gt;
First, create the texture handle, map data stream and write to it. Note that you need to perform this step '''before''' loading resources from disk (using &amp;lt;code&amp;gt;H3dutLoadResourcesFromDisk()&amp;lt;/code&amp;gt;)! Otherwise, the texture creation will fail.&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes texRes = h3dCreateTexture( &amp;quot;myTexRes&amp;quot;, 64, 64, H3DFormats::TEX_RGBA16F, H3DResFlags::NoTexMipmaps );&lt;br /&gt;
float *data = static_cast&amp;lt;float*&amp;gt;( h3dMapResStream( texRes, H3DTexRes::ImageElem, 0, H3DTexRes::ImgPixelStream, false, true ) );&lt;br /&gt;
for( int row=0; row&amp;lt;64; ++row )&lt;br /&gt;
{&lt;br /&gt;
    float *rowPtr = data + row*64*4;&lt;br /&gt;
    for( int col=0; col&amp;lt;64; ++col )&lt;br /&gt;
    {&lt;br /&gt;
        float *sample = rowPtr + col*4;&lt;br /&gt;
        sample[0] = ...; // R&lt;br /&gt;
        sample[1] = ...; // G&lt;br /&gt;
        sample[2] = ...; // B&lt;br /&gt;
        sample[3] = ...; // A&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
h3dUnmapResStream( texRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Second, to bind the texture to a shader, you need to include it in the material XML file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Material&amp;gt;&lt;br /&gt;
    &amp;lt;Shader source=&amp;quot;shaders/myshader.shader&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Sampler name=&amp;quot;myTexture&amp;quot; map=&amp;quot;myTexRes&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Material&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, to reference the sampler in the shader, you need to declare it like this:&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= Shader Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
[[FX]]&lt;br /&gt;
sampler myTexture;&lt;br /&gt;
&lt;br /&gt;
// ... declare other samplers, contexts etc.&lt;br /&gt;
&lt;br /&gt;
[[FS_LIGHTING]]&lt;br /&gt;
&lt;br /&gt;
varying vec2 texCoords; // ... assumed given by vertex shader ...&lt;br /&gt;
uniform sampler2D myTexture;&lt;br /&gt;
&lt;br /&gt;
void main( void )&lt;br /&gt;
{&lt;br /&gt;
  gl_FragColor = texture2D( myTexture, texCoords );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
Information taken from [http://www.horde3d.org/forums/viewtopic.php?f=2&amp;amp;t=965 this thread] on the forums.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to modify vertex data ==&lt;br /&gt;
&lt;br /&gt;
Vertex data is stored as streams in geometry resources. A pointer to the vertex data can be obtained by mapping a stream. The following code modifies the y coordinates of all vertex positions stored in the specified geometry resource.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
int vertCount = h3dGetResParamI( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertexCountI );&lt;br /&gt;
float *pVertPosData = (float *)h3dMapResStream( myGeoRes, H3DGeoRes::GeometryElem, 0, H3DGeoRes::GeoVertPosStream, true, true );&lt;br /&gt;
&lt;br /&gt;
for( int i = 0; i &amp;lt; vertCount; ++i )&lt;br /&gt;
{&lt;br /&gt;
    pVertPosData[i * 3 + 1] = pVertPosData[i * 3 + 1] * 2;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h3dUnmapResStream( myGeoRes );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to exchange a texture of a mesh ==&lt;br /&gt;
&lt;br /&gt;
Consider you want to exchange the diffuse texture (sampler named ''albedoMap'') of a given mesh (with node handle ''myMesh'') by a texture resource with resource handle ''myNewTex''. You can do that with the following code:&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|&lt;br /&gt;
description= C++ Code|&lt;br /&gt;
code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
H3DRes matRes = h3dGetNodeParamI( myMesh, H3DMesh::MatResI );&lt;br /&gt;
int idx = h3dFindResElem( matRes, H3DMatRes::SamplerElem, H3DMatRes::SampNameStr, &amp;quot;albedoMap&amp;quot; );&lt;br /&gt;
h3dSetResParamI( matRes, H3DMatRes::SamplerElem, idx, H3DMatRes::SampTexResI, myNewTex );&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
First you need to retrieve the material used by the mesh. After that, you can find the desired sampler in the material. Finally, once you have the sampler index, you can access the sampler data and override its texture resource.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The code above changes directly the material resource. If several meshes are using the same material, all of them will have the new texture. If that is not desired, you can create a private copy of the material by cloning it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to display text in the scene ==&lt;br /&gt;
&lt;br /&gt;
Usually, text is displayed as part of a GUI or HUD on top of the scene. However, sometimes it can be useful to display text inside the scene at the location of a specific node. The following snippet displays the names of all models at the nodes' origins. For obtaining the right screen position, the node positions are projected and converted to overlay coordinates.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= C++ Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
// Get camera view matrix&lt;br /&gt;
const float *camTrans;&lt;br /&gt;
h3dGetNodeTransMats( _cam, 0x0, &amp;amp;camTrans );&lt;br /&gt;
Matrix4f viewMat( Matrix4f( camTrans ).inverted() );&lt;br /&gt;
&lt;br /&gt;
// Get camera projection matrix&lt;br /&gt;
float camProj[16];&lt;br /&gt;
h3dGetCameraProjMat( _cam, camProj );&lt;br /&gt;
Matrix4f projMat( camProj );&lt;br /&gt;
&lt;br /&gt;
// Loop over all model nodes&lt;br /&gt;
int cnt = h3dFindNodes( H3DRootNode, &amp;quot;&amp;quot;, H3DNodeTypes::Model );&lt;br /&gt;
for( int i = 0; i &amp;lt; cnt; ++i )&lt;br /&gt;
{&lt;br /&gt;
	// Get node name&lt;br /&gt;
	H3DNode node = h3dGetNodeFindResult( i );&lt;br /&gt;
	const char *name = h3dGetNodeParamStr( node, H3DNodeParams::NameStr );&lt;br /&gt;
&lt;br /&gt;
	// Get node position&lt;br /&gt;
	const float *nodeTrans;&lt;br /&gt;
	h3dGetNodeTransMats( node, 0, &amp;amp;nodeTrans ); &lt;br /&gt;
	Vec4f pos( nodeTrans[12], nodeTrans[13], nodeTrans[14], 1 );&lt;br /&gt;
&lt;br /&gt;
	// Project&lt;br /&gt;
	pos = projMat * viewMat * pos;&lt;br /&gt;
	float x = pos.x / pos.w;&lt;br /&gt;
	float y = pos.y / pos.w;&lt;br /&gt;
&lt;br /&gt;
	// Transform to overlay coordinates&lt;br /&gt;
	x = x * 0.5f + 0.5f;&lt;br /&gt;
	y = -y * 0.5f + 0.5f;&lt;br /&gt;
&lt;br /&gt;
	// Show text (avoid back-projection)&lt;br /&gt;
	if( pos.w &amp;gt; 0 ) h3dutShowText( name, x, y, 0.02f, 1.0f, 1.0f, 1.0f, _fontMatRes, 0 );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to tell the camera to look at a point ==&lt;br /&gt;
&lt;br /&gt;
Only pseudo code here, how the math behind this works can be found by searching for gluLookAt.&lt;br /&gt;
&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
forward = targetPosition - cameraPosition&lt;br /&gt;
forward = normalize(forward)&lt;br /&gt;
&lt;br /&gt;
up = Vector3(0, 1, 0) # vector pointing &amp;quot;up&amp;quot;, can be almost any vector&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
right = cross(forward, up)&lt;br /&gt;
right = normalize(right)&lt;br /&gt;
&lt;br /&gt;
up = cross(right, forward)&lt;br /&gt;
up = normalize(up)&lt;br /&gt;
&lt;br /&gt;
# rotation matrix, column major format&lt;br /&gt;
m1 = [right.x, up.x, -forward.x, 0,&lt;br /&gt;
    right.y, up.y, -forward.y, 0,&lt;br /&gt;
    right.z, up.z, -forward.z, 0,&lt;br /&gt;
    0, 0, 0, 1]&lt;br /&gt;
&lt;br /&gt;
# translation matrix, column major format&lt;br /&gt;
m2 = [1, 0, 0, 0,&lt;br /&gt;
    0, 1, 0, 0,&lt;br /&gt;
    0, 0, 1, 0,&lt;br /&gt;
    -cameraPosition.x, -cameraPosition.y, -cameraPosition.z, 1]&lt;br /&gt;
&lt;br /&gt;
# combined transformation matrix (&amp;quot;view&amp;quot; matrix)&lt;br /&gt;
m3 = m1 * m2&lt;br /&gt;
&lt;br /&gt;
# since the camera node is just another node in Horde3D we have to invert the matrix m3&lt;br /&gt;
m3 = invert(m3)&lt;br /&gt;
&lt;br /&gt;
h3dSetNodeTransMat(cameraNode, m3)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
This example will fail when either forward is a zero vector or forward is parallel to the choosen up vector.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to orbit / rotate the camera around a point ==&lt;br /&gt;
{{CppSourceCode|description= Pseudo Code|code=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# setup: create an anchor node, so that the camera can always rotate around a relative (0, 0, 0) point&lt;br /&gt;
anchorNode = h3dAddGroupNode(h3dRootNode, 'camera-anchor')&lt;br /&gt;
cameraNode = h3dAddCameraNode(anchorNode, 'camera-orbiter')&lt;br /&gt;
&lt;br /&gt;
# basically calculate point on the surface of a sphere&lt;br /&gt;
# by using distance and two angles&lt;br /&gt;
&lt;br /&gt;
phi = phi % 360.0&lt;br /&gt;
theta = theta % 360.0&lt;br /&gt;
&lt;br /&gt;
if phi &amp;lt; 0: # will break for phi=0 and theta=0 otherwise&lt;br /&gt;
    phi = 0.0001&lt;br /&gt;
&lt;br /&gt;
r = distance&lt;br /&gt;
p = radians(phi)&lt;br /&gt;
t = radians(theta)&lt;br /&gt;
&lt;br /&gt;
x = r * cos(t) * sin(p)&lt;br /&gt;
y = r * cos(p)&lt;br /&gt;
z = r * sin(t) * sin(p)&lt;br /&gt;
&lt;br /&gt;
# calculate vectors for camera look at&lt;br /&gt;
forward = Vector3(0, 0, 0,) - Vector3(x, y, z)&lt;br /&gt;
if phi &amp;gt;= 180.0:&lt;br /&gt;
    up = Vector3(0, 1, 0)&lt;br /&gt;
else:&lt;br /&gt;
    up = Vector3(0, -1, 0)&lt;br /&gt;
&lt;br /&gt;
# with the forward and up vector use the code from the look at example to point the camera at the point (0, 0, 0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
When following another scene node use that node instead of h3dRootNode as a parent in the h3dAddGroupNode call.&lt;/div&gt;</summary>
		<author><name>Roland</name></author>	</entry>

	</feed>