<?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=Codepoet</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=Codepoet"/>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Special:Contributions/Codepoet"/>
		<updated>2026-04-09T08:53:55Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.3</generator>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=660</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=660"/>
				<updated>2010-03-10T12:56:20Z</updated>
		
		<summary type="html">&lt;p&gt;Codepoet: added pseudo code for orbiting a camera around a point / another node&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 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, elemIdx, 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>Codepoet</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Horde3D_Wiki:HOWTO&amp;diff=659</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=659"/>
				<updated>2010-03-10T12:42:18Z</updated>
		
		<summary type="html">&lt;p&gt;Codepoet: added pseudo code for gluLookAt equivalent&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 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, elemIdx, 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;/div&gt;</summary>
		<author><name>Codepoet</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Terrain_Extension&amp;diff=248</id>
		<title>Terrain Extension</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Terrain_Extension&amp;diff=248"/>
				<updated>2008-06-08T13:08:50Z</updated>
		
		<summary type="html">&lt;p&gt;Codepoet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category: Extensions]]&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; &lt;br /&gt;
| {{ContentBlock|width=800|color=white |content=&lt;br /&gt;
The Terrain Extension extends Horde3D with the capability to render large landscapes. A special level of detail algorithm adapts the resolution of the terrain mesh so that near regions get more details than remote ones. The algorithm also considers the geometric complexity of the terrain to increase the resolution solely where this is really required. This makes the rendering fast and provides a high quality with a minimum of popping artifacts.&lt;br /&gt;
	&lt;br /&gt;
A height map is used to define the altitude of the terrain. The height map is a usual texture map that encodes 16 bit height information in two channels. The red channel of the texture contains the coarse height, while the green channel encodes finer graduations. The encoding of the information is usually done with an appropriate tool. If you just want to use 8 bit height information, you can simply copy the greyscale image to the red channel of the height map and leave the green channel black.&lt;br /&gt;
&lt;br /&gt;
= Installation Windows =	&lt;br /&gt;
To install the extension, simply copy the contents of the extension root directory to the Horde3D SDK folder and merge the directories. In Visual Studio, add the extension and sample projects to the solution. Then add the extension project to the project dependencies of the Horde3D Engine and the Horde3D Engine to the dependencies of the Terrain Sample. After that, include 'Terrain/extension.h' in 'egExtensions.cpp' of the engine and add '#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )' to link against the terrain extension (under Windows). Finally, add the following line to ExtensionManager::installExtensions to register the extension:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
installExtension( Horde3DTerrain::getExtensionName, &lt;br /&gt;
Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The extension is then part of the Horde3D DLL and can be used with the Horde3DTerrain.h header file.&lt;br /&gt;
&lt;br /&gt;
= Installation Linux =&lt;br /&gt;
Go to your target directory where you want to install Horde3D. Then extract the files, replace versions as needed.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unzip Horde3D_SDK_1.0.0_Beta1.zip&lt;br /&gt;
unzip Horde3D_ExtTerrain_0.1.1.zip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now change Horde3D/Source/Horde3D Engine/egExtensions.cpp. Basically just uncomment all lines with code regarding the terrain extension:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--- Horde3D/Source/Horde3D Engine/egExtensions.cpp.old        2008-04-14 23:19:44.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/egExtensions.cpp    2008-04-14 22:56:19.000000000 +0200&lt;br /&gt;
@@ -25,16 +25,16 @@&lt;br /&gt;
 #include &amp;quot;egExtensions.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 // Include files for extensions&lt;br /&gt;
-//#include &amp;quot;Terrain/Source/extension.h&amp;quot;&lt;br /&gt;
+#include &amp;quot;Terrain/Source/extension.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 // Lib files for extensions&lt;br /&gt;
-//#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )&lt;br /&gt;
+#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bool ExtensionManager::installExtensions()&lt;br /&gt;
 {&lt;br /&gt;
        // Install desired extensions here&lt;br /&gt;
-       //installExtension( Horde3DTerrain::getExtensionName, &lt;br /&gt;
Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );&lt;br /&gt;
+       installExtension( Horde3DTerrain::getExtensionName, &lt;br /&gt;
Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now fix Horde3D/Source/Horde3D Engine/makefile:&lt;br /&gt;
&amp;lt;pre&amp;gt;--- Horde3D/Source/Horde3D Engine/makefile.old      2008-04-01 20:42:58.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/makefile     2008-04-14 23:09:49.000000000 +0200&lt;br /&gt;
@@ -6,13 +6,15 @@&lt;br /&gt;
        egRenderer.o egResource.o egScene.o egSceneGraphRes.o egShader.o egTextures.o \&lt;br /&gt;
        utImage.o utOpenGL.o ../Shared/utXMLParser.o&lt;br /&gt;
&lt;br /&gt;
+TERRAIN_OBJECTS = ../../../Extensions/Terrain/Source/extension.o &lt;br /&gt;
../../../Extensions/Terrain/Source/terrain.o&lt;br /&gt;
+&lt;br /&gt;
&lt;br /&gt;
 libHorde3D: $(OBJECTS)&lt;br /&gt;
-       g++ $(OBJECTS) -olibHorde3D.so -lGL -shared&lt;br /&gt;
+       g++ $(OBJECTS) $(TERRAIN_OBJECTS) -olibHorde3D.so -lGL -shared&lt;br /&gt;
        mv libHorde3D.so ../../Binaries/Linux_x86&lt;br /&gt;
&lt;br /&gt;
 %.o: %.cpp&lt;br /&gt;
-       g++ -c $&amp;lt; -o$@ -I../Shared -I../../Extensions -fPIC ${CFLAGS}&lt;br /&gt;
+       g++ -c $&amp;lt; -o$@ -I../Shared -I../../../Extensions -fPIC ${CFLAGS}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 clean:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the 1.0.0 Beta1 on a 64 bit system you have to fix Horde3D/Source/Horde3D Engine/utImage.cpp:&lt;br /&gt;
&amp;lt;pre&amp;gt;--- Horde3D/Source/Horde3D Engine/utImage.cpp.old   2008-04-01 23:28:22.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/utImage.cpp 2008-04-14 23:03:28.000000000 +0200&lt;br /&gt;
@@ -1257,7 +1257,7 @@&lt;br /&gt;
          }&lt;br /&gt;
          return e(&amp;quot;outofmem&amp;quot;, &amp;quot;Out of memory&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
-      img_comp[i].data = (uint8*) (((int) img_comp[i].raw_data + 15) &amp;amp; ~15);&lt;br /&gt;
+      img_comp[i].data = (uint8*) (((size_t) img_comp[i].raw_data + 15) &amp;amp; ~15);&lt;br /&gt;
       img_comp[i].linebuf = NULL;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can compile the project: Call make in the following directories in the specified order:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Extensions/Terrain/Source&lt;br /&gt;
Horde3D&lt;br /&gt;
Extensions/Terrain/Sample&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now everything should be working. Go to Horde3D/Binaries/Linux_x86 to try the samples.&lt;br /&gt;
&lt;br /&gt;
= Using the extension =&lt;br /&gt;
&lt;br /&gt;
The extension defines the uniform *terBlockParams* and the attribute *terHeight* that can be used in a shader to render the terrain. To see how this is working in detail, have a look at the included sample shader.&lt;br /&gt;
&lt;br /&gt;
In the Terrain Sample distributed with the extension, there's also a normal map encoded in the heightmap texture. The data for the &lt;br /&gt;
normal map is encoded in the blue and alpha channel. A simple tool to create such a combined normal height map is integrated in the Horde3D Scene Editor. It can use 8-bit or 16-bit images as heightmap input. In case of 8-bit images you can also specify a smoothing operator to convert the 8-bit heightmap into a more smooth 16-bit one.&lt;br /&gt;
As an alternative to the Horde3D Scene Editor you can also use a small command line tool: [http://www.horde3d.org/forums/viewtopic.php?f=6&amp;amp;t=364]&lt;br /&gt;
}} &amp;lt;!-- Right panel --&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |{{Extension_Summary|&lt;br /&gt;
name = Terrain Extension|&lt;br /&gt;
screenshot = H3Dterrain.jpg|&lt;br /&gt;
description = The Terrain Extension extends Horde3D with the capability to render large landscapes.|&lt;br /&gt;
version = 0.1.0|&lt;br /&gt;
horde3dversion = 0.15|&lt;br /&gt;
released = 2008-03-30|&lt;br /&gt;
author = Nicolas Schulz and Volker Wiendl|&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Codepoet</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Main_Page&amp;diff=220</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Main_Page&amp;diff=220"/>
				<updated>2008-04-27T17:05:45Z</updated>
		
		<summary type="html">&lt;p&gt;Codepoet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOEDITSECTION__ __NOTOC__&lt;br /&gt;
{|  width=&amp;quot;800&amp;quot; border=&amp;quot;0&amp;quot; &lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; | &amp;lt;!-- Top --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Welcome Message --&amp;gt;&lt;br /&gt;
{{ContentBlock|width=806|color=orange&lt;br /&gt;
|content= &lt;br /&gt;
'''Welcome to the wiki for the open source next-generation graphics engine Horde3D.'''&lt;br /&gt;
&lt;br /&gt;
This wiki collects information about how to make best use of the numerous features of Horde3D. Since it is a collaborative effort to which all community members are invited to contribute, the Horde3D team does not take any responsibility for the content or the accuracy of the content provided on these pages.&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
{{ContentBlock|width=806|thickness=2 |color=#BFBFBF&lt;br /&gt;
|content=&lt;br /&gt;
{{Filmstrip}}&lt;br /&gt;
|description= [[Gallery]]: Here are a few of the [[samples]], add your own and get famous. [[Gallery|more...]]&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock}}&lt;br /&gt;
|- &lt;br /&gt;
|valign=&amp;quot;top&amp;quot; | &amp;lt;!-- Left Panel --&amp;gt;&lt;br /&gt;
{{ContentBlock|width=500|color=#FF9900&lt;br /&gt;
|icon=InfoIcon.png&lt;br /&gt;
|iconsize=32&lt;br /&gt;
|halign=top&lt;br /&gt;
|header=Getting Started&lt;br /&gt;
|sub-header=Start here to learn all the H3D basics.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
* [http://www.horde3d.org/features.html Features supported by Horde3D.]&lt;br /&gt;
* [http://www.horde3d.org/screenshots.html Screenshots of sample applications created with Horde3D.]&lt;br /&gt;
* [http://www.horde3d.org/docs/_tutorial.html A small introductory tutorial which shows the API style.]&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock|1|1}}&lt;br /&gt;
{{ContentBlock|width=500|color=#FFCC33&lt;br /&gt;
|icon=DevIcon.png&lt;br /&gt;
|iconsize=32&lt;br /&gt;
|halign=top&lt;br /&gt;
|header=Using Horde&lt;br /&gt;
|sub-header=Practical usage of the engine.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
* [http://www.horde3d.org/docs/_usageguide.html#Concepts Introduction to basic concepts.]&lt;br /&gt;
* [http://www.horde3d.org/docs/_usageguide.html#Content Advice for bringing content to the engine.]&lt;br /&gt;
* [http://www.horde3d.org/docs/_usageguide.html#Advanced Introduction to more advanced topics.]&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock|1|1}}&lt;br /&gt;
{{ContentBlock|width=500|color=#FF9900&lt;br /&gt;
|icon=ResourcesIcon.png&lt;br /&gt;
|iconsize=32&lt;br /&gt;
|halign=top&lt;br /&gt;
|header=Resources&lt;br /&gt;
|sub-header=Explore the website, forums, and [[Horde3D_Wiki:Community_Portal| Community Portal]].&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
* [[Horde3D_Wiki:Community_Portal | The Community Portal Tutorials.]]&lt;br /&gt;
* [http://www.horde3d.org/ Official Horde3D Website.]&lt;br /&gt;
* [http://www.horde3d.org/forums/ Forums for discussions and support.]&lt;br /&gt;
* [http://www.horde3d.org/docs/manual.html Horde3D Manual.]&lt;br /&gt;
* [http://mm-werkstatt.informatik.uni-augsburg.de/project_details.php?id=45 Official Horde3D Editor]&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock|1|1}}&lt;br /&gt;
{{ContentBlock|width=500|color=#FFCC33&lt;br /&gt;
|icon=HighlightIcon.png&lt;br /&gt;
|iconsize=32&lt;br /&gt;
|header=Project Spotlights&lt;br /&gt;
|sub-header=This Month: Official Horde3D Editor.&lt;br /&gt;
|content={{!!}}&lt;br /&gt;
[[Image:H3Deditor.jpg|frame|left|H3D Editor]] &lt;br /&gt;
*[[Editor Features]]&lt;br /&gt;
*[[Editor Tutorials]]&lt;br /&gt;
*[[Future Enhancements]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
|valign=&amp;quot;top&amp;quot; | &amp;lt;!-- Right Panel --&amp;gt;&lt;br /&gt;
{{ContentBlock|width=300|header=Download Horde3D|icon=Download45.png |sub-header=Stable Release: v1.0 beta1&lt;br /&gt;
|center=true&lt;br /&gt;
|content= &lt;br /&gt;
'''Get [[Distribution]]'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://downloads.sourceforge.net/horde3d/Horde3D_SDK_1.0.0_Beta1.zip&amp;quot; &amp;gt;&amp;lt;img src=&amp;quot;http://www.horde3d.org/wiki/images/6/66/WinXP80.png&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://www.mediafire.com/?csrwjww9dhe&amp;quot; &amp;gt;&amp;lt;img src=&amp;quot;http://www.horde3d.org/wiki/images/6/60/MacOSX80.png&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://www.horde3d.org/downloads/Horde3D%20SDK%20%5B0.15.0%5D.zip&amp;quot; &amp;gt;&amp;lt;img src=&amp;quot;http://www.horde3d.org/wiki/images/3/3d/Ubunto80.png&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Get [[SVN Source Instructions]]'''&lt;br /&gt;
{{SpacerBlock|294|2|color=#FF9900}}&lt;br /&gt;
{{ContentBlock|width=300|width=294 |thickness=0 |content-color=#FFFFCC&lt;br /&gt;
|center=true&lt;br /&gt;
|content=&lt;br /&gt;
'''[[Language Bindings]]:'''&lt;br /&gt;
&lt;br /&gt;
[[JavaBindings|Java]] • [[dotNETBindings|.NET]] • [[DBindings|Digitalmars D]] • [[PyBindings|Python]]&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock|294|1|color=#FF9900}}&lt;br /&gt;
}}&lt;br /&gt;
{{SpacerBlock|1|1}}&lt;br /&gt;
{{ContentBlock|width=300|&lt;br /&gt;
|icon=DevIcon45.png&lt;br /&gt;
|header=[[Development | Horde3D Development]]&lt;br /&gt;
|sub-header=[[Current events | Current Events]]: v1.0&lt;br /&gt;
|content-color=#FFFFCC&lt;br /&gt;
|content=&lt;br /&gt;
These pages are only of interest to developers who are modifying Horde itself, or developing extensions.&lt;br /&gt;
=== [[Hardware]] ===&lt;br /&gt;
*[[ATI Development]] - Issues specific to ATI Cards&lt;br /&gt;
*[[NVidia Development]] - Issues specific to NVidia Cards&lt;br /&gt;
=== [[Platforms]] ===&lt;br /&gt;
*[[Windows Development]] - Issues specific to Microsoft Windows.&lt;br /&gt;
*[[Linux Development]] - Issues specific to Linux.&lt;br /&gt;
*[[Mac OS X Development]] - Issues specific to Mac OS X.&lt;br /&gt;
=== [[Extensions]] === &lt;br /&gt;
*[[Terrain Extension]] - Adds Large Terrain support.&lt;br /&gt;
*[[Bullet Physics]] - Connects Bullet Physics Engine to Horde3D.&lt;br /&gt;
}}&lt;br /&gt;
|- &lt;br /&gt;
|  colspan=&amp;quot;2&amp;quot; | &amp;lt;!-- Bottom --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Sample Gallery --&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Codepoet</name></author>	</entry>

	<entry>
		<id>http://horde3d.org/wiki/index.php?title=Terrain_Extension&amp;diff=114</id>
		<title>Terrain Extension</title>
		<link rel="alternate" type="text/html" href="http://horde3d.org/wiki/index.php?title=Terrain_Extension&amp;diff=114"/>
				<updated>2008-04-14T21:30:12Z</updated>
		
		<summary type="html">&lt;p&gt;Codepoet: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category: Extensions]]&lt;br /&gt;
&lt;br /&gt;
{{Extension_Summary|&lt;br /&gt;
name = Terrain Extension|&lt;br /&gt;
image = http://www.horde3d.org/screenshots/terrain.jpg|&lt;br /&gt;
description = The Terrain Extension extends Horde3D with the capability to render large landscapes.|&lt;br /&gt;
version = 0.1.0|&lt;br /&gt;
horde3dversion = 0.15|&lt;br /&gt;
released = 2008-03-30|&lt;br /&gt;
author = Nicolas Schulz and Volker Wiendl|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Terrain Extension extends Horde3D with the capability to render large landscapes. A special&lt;br /&gt;
level of detail algorithm adapts the resolution of the terrain mesh so that near regions get&lt;br /&gt;
more details than remote ones. The algorithm also considers the geometric complexity of the&lt;br /&gt;
terrain to increase the resoultion solely where this is really required. This makes the&lt;br /&gt;
rendering fast and provides a high quality with a minimum of popping artifacts.&lt;br /&gt;
	&lt;br /&gt;
A height map is used to define the altitude of the terrain. The height map is a usual texture&lt;br /&gt;
map that encodes 16 bit height information in two channels. The red channel of the texture&lt;br /&gt;
contains the coarse height, while the green channel encodes finer graduations. The encoding of&lt;br /&gt;
the information is usually done with an appropriate tool. If you just want to use 8 bit&lt;br /&gt;
height information, you can simply copy the greyscale image to the red channel of the height&lt;br /&gt;
map and leave the green channel black.&lt;br /&gt;
&lt;br /&gt;
= Installation Windows =	&lt;br /&gt;
To install the extension, simply copy the contents of the extension root directory to the Horde3D&lt;br /&gt;
SDK folder and merge the directories. In Visual Studio, add the extension and sample projects to&lt;br /&gt;
the solution. Then add the extension project to the project dependencies of the Horde3D Engine and&lt;br /&gt;
the Horde3D Engine to the dependencies of the Terrain Sample. After that, include 'Terrain/extension.h'&lt;br /&gt;
in 'egExtensions.cpp' of the engine and add '#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )' to link&lt;br /&gt;
against the terrain extension (under Windows). Finally, add the following line to ExtensionManager::installExtensions&lt;br /&gt;
to register the extension:&lt;br /&gt;
&lt;br /&gt;
'''installExtension( Horde3DTerrain::getExtensionName, Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );'''&lt;br /&gt;
&lt;br /&gt;
The extension is then part of the Horde3D DLL and can be used with the Horde3DTerrain.h header file.&lt;br /&gt;
&lt;br /&gt;
= Installation Linux =&lt;br /&gt;
Go to your target directory where you want to install Horde3D. Then extract the files, replace versions as needed.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;unzip Horde3D_SDK_1.0.0_Beta1.zip&lt;br /&gt;
unzip Horde3D_ExtTerrain_0.1.1.zip&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Now change Horde3D/Source/Horde3D Engine/egExtensions.cpp. Basically just uncomment all lines with code regarding the terrain extension:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;--- Horde3D/Source/Horde3D Engine/egExtensions.cpp.old        2008-04-14 23:19:44.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/egExtensions.cpp    2008-04-14 22:56:19.000000000 +0200&lt;br /&gt;
@@ -25,16 +25,16 @@&lt;br /&gt;
 #include &amp;quot;egExtensions.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 // Include files for extensions&lt;br /&gt;
-//#include &amp;quot;Terrain/Source/extension.h&amp;quot;&lt;br /&gt;
+#include &amp;quot;Terrain/Source/extension.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 // Lib files for extensions&lt;br /&gt;
-//#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )&lt;br /&gt;
+#pragma comment( lib, &amp;quot;Extension_Terrain.lib&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 bool ExtensionManager::installExtensions()&lt;br /&gt;
 {&lt;br /&gt;
        // Install desired extensions here&lt;br /&gt;
-       //installExtension( Horde3DTerrain::getExtensionName, Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );&lt;br /&gt;
+       installExtension( Horde3DTerrain::getExtensionName, Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );&lt;br /&gt;
&lt;br /&gt;
        return true;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now fix Horde3D/Source/Horde3D Engine/makefile:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;--- Horde3D/Source/Horde3D Engine/makefile.old      2008-04-01 20:42:58.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/makefile     2008-04-14 23:09:49.000000000 +0200&lt;br /&gt;
@@ -6,13 +6,15 @@&lt;br /&gt;
        egRenderer.o egResource.o egScene.o egSceneGraphRes.o egShader.o egTextures.o \&lt;br /&gt;
        utImage.o utOpenGL.o ../Shared/utXMLParser.o&lt;br /&gt;
&lt;br /&gt;
+TERRAIN_OBJECTS = ../../../Extensions/Terrain/Source/extension.o ../../../Extensions/Terrain/Source/terrain.o&lt;br /&gt;
+&lt;br /&gt;
&lt;br /&gt;
 libHorde3D: $(OBJECTS)&lt;br /&gt;
-       g++ $(OBJECTS) -olibHorde3D.so -lGL -shared&lt;br /&gt;
+       g++ $(OBJECTS) $(TERRAIN_OBJECTS) -olibHorde3D.so -lGL -shared&lt;br /&gt;
        mv libHorde3D.so ../../Binaries/Linux_x86&lt;br /&gt;
&lt;br /&gt;
 %.o: %.cpp&lt;br /&gt;
-       g++ -c $&amp;lt; -o$@ -I../Shared -I../../Extensions -fPIC ${CFLAGS}&lt;br /&gt;
+       g++ -c $&amp;lt; -o$@ -I../Shared -I../../../Extensions -fPIC ${CFLAGS}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 clean:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using the 1.0.0 Beta1 on a 64 bit system you have to fix Horde3D/Source/Horde3D Engine/utImage.cpp:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;--- Horde3D/Source/Horde3D Engine/utImage.cpp.old   2008-04-01 23:28:22.000000000 +0200&lt;br /&gt;
+++ Horde3D/Source/Horde3D Engine/utImage.cpp 2008-04-14 23:03:28.000000000 +0200&lt;br /&gt;
@@ -1257,7 +1257,7 @@&lt;br /&gt;
          }&lt;br /&gt;
          return e(&amp;quot;outofmem&amp;quot;, &amp;quot;Out of memory&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
-      img_comp[i].data = (uint8*) (((int) img_comp[i].raw_data + 15) &amp;amp; ~15);&lt;br /&gt;
+      img_comp[i].data = (uint8*) (((size_t) img_comp[i].raw_data + 15) &amp;amp; ~15);&lt;br /&gt;
       img_comp[i].linebuf = NULL;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can compile the project: Call make in the following directories in the specified order:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;Extensions/Terrain/Source&lt;br /&gt;
Horde3D&lt;br /&gt;
Extensions/Terrain/Sample&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now everything should be working. Go to Horde3D/Binaries/Linux_x86 to try the samples.&lt;br /&gt;
&lt;br /&gt;
= Using the extension =&lt;br /&gt;
&lt;br /&gt;
The extension defines the uniform *terBlockParams* and the attribute *terHeight* that can be used&lt;br /&gt;
in a shader to render the terrain. To see how this is working in detail, have a look at the included&lt;br /&gt;
sample shader.&lt;br /&gt;
&lt;br /&gt;
In the Terrain Sample distributed with the extension, there's also a normal map encoded in the heightmap texture. The data for the &lt;br /&gt;
normal map is encoded in the blue and alpha channel. A simple tool to create such a&lt;br /&gt;
combined normal height map is integrated in the Horde3D Scene Editor. It can use 8-bit or 16-bit images as heightmap input. In case of 8-bit &lt;br /&gt;
images you can also specify a smoothing operator to convert the 8-bit heightmap into a more smooth 16-bit one&lt;/div&gt;</summary>
		<author><name>Codepoet</name></author>	</entry>

	</feed>