Forum
Contact





DirectX using C#
DirectX using C++
DirectX using Visual Basic



Latest Forum posts

 Texture on a 3d Object
  Posted by: ToastbrotX
  When: 10/09/2010 at 10:23:08

 Unable to Build
  Posted by: Rich_Zap
  When: 09/09/2010 at 15:39:33

 HLSL calculating normals
  Posted by: Rich_Zap
  When: 09/09/2010 at 15:34:56

 Texture on a 3d Object
  Posted by: ToastbrotX
  When: 09/09/2010 at 11:14:19

 DRIVER ERROR XBOX 360
  Posted by: Anonymous
  When: 09/09/2010 at 01:12:47

 Reflection problem in corners ...
  Posted by: Anonymous
  When: 08/09/2010 at 21:03:35

 Texture on a 3d Object
  Posted by: radulph
  When: 08/09/2010 at 17:34:01

 InvalidDataException???
  Posted by: Anonymous
  When: 08/09/2010 at 09:10:36

 Unable to Build
  Posted by: Anonymous
  When: 08/09/2010 at 07:49:36

 Suggestion to change a few lines
  Posted by: Insomnica
  When: 06/09/2010 at 14:37:05

 Collision with series 1
  Posted by: radulph
  When: 05/09/2010 at 13:33:14

 HLSL calculating normals
  Posted by: miroslavign
  When: 04/09/2010 at 17:26:26

 Collision with series 1
  Posted by: ToastbrotX
  When: 04/09/2010 at 16:52:02

 HLSL calculating normals
  Posted by: Rich_Zap
  When: 04/09/2010 at 15:00:20

 Collision with series 1
  Posted by: ToastbrotX
  When: 04/09/2010 at 12:28:41

 HLSL calculating normals
  Posted by: miroslavign
  When: 04/09/2010 at 08:46:31

 Walk along a wall
  Posted by: Anonymous
  When: 03/09/2010 at 10:28:02

 model problems
  Posted by: muffinman
  When: 03/09/2010 at 06:47:32

 Vertices problem
  Posted by: Anonymous
  When: 03/09/2010 at 05:48:35

 OcTree Question
  Posted by: Zorzomezz
  When: 03/09/2010 at 04:07:03




Topic: normx



  
Goto parent category
  
Create a new user account


   normx
 Poster : vijay
 Posts: 60
 Country : India
 City: Trichy

  
Posted by vijay on 03/07/2008 at 03:43:10
Hi Riemer,
Thank u very much for ur tutorials..
In this chapter can u explain me what does normx vector do...


Vector3 normX = new Vector3((terrainVertices[x - 1 + y * WIDTH].Position.Z - terrainVertices[x + 1 + y * WIDTH].Position.Z) / 2, 0, 1);
             Vector3 normY = new Vector3(0, (terrainVertices[x + (y - 1) * WIDTH].Position.Z - terrainVertices[x + (y + 1) * WIDTH].Position.Z) / 2, 1);
 Poster : Archenon
 Posts: 397
 Country : Romania
 City: Oradea

  
Posted by Archenon on 03/07/2008 at 04:55:00
I think here you calculate the average normal vector for the vertex.

The vertexes which is on the edge should have its normal vector the average normal vector of the triangles.
 Poster : vijay
 Posts: 60
 Country : India
 City: Trichy

  
Posted by vijay on 03/07/2008 at 06:15:03
Thank u for ur reply,
Initially they r in what position why we are calculating the normal vector...
 Poster : riemer
 Posts: 1388
 Country : Belgium
 City: Antwerp

  
Posted by riemer on 03/07/2008 at 13:26:09
They indicate the 'steepness' at that position, as they're the first derivative of the height at that position.

However, you should use the CalculateNormals method of series 1 instead. In a few days, I will put the updates Series 4 online.
 Poster : ieldanth
 Posts: 13
 Country : US
 City: Lebanon

  
Posted by ieldanth on 08/07/2008 at 00:59:50
Steepness is useful for multitexturing on terrains amongst other things.  

Just blending over to a sort of cubemap version of the rock texture based on the steepness of the terrain helps keep the terrain from looking like a stretched skin.  It's an old technique adapted from landscape generating programs like Terragen.
 Poster : m_Maky
 Posts: 67
 Country : france
 City: Nice

  
Posted by m_Maky on 08/07/2008 at 03:22:52
can you post a screenshot of this? it sounds intresting!
 Poster : ieldanth
 Posts: 13
 Country : US
 City: Lebanon

  
Posted by ieldanth on 08/07/2008 at 17:15:37
Sure!  I'm a beginner at this so the code would need a massive tweak overhaul.  Getting about 30fps.

 Poster : Quasar
 Posts: 121
 Country : Australia
 City: Brisbane

  
Posted by Quasar on 08/07/2008 at 19:04:39
I was already planning on applying a cliff texture to steep slopes, but the idea of using a cubemap to prevent the texture being stretched never occured to me. I'll have to have a look into it...

If it works I owe you a beer, ieldanth.

  
Post a new reply
 





Google
 
Web www.riemers.net
If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !
- Website design & DirectX code : Riemer Grootjans -
©2006 Riemer Grootjans


News
Home
Forum
XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
XNA 3.0 using C# (89)
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Series 3: HLSL (19)
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
DirectX using VB (2)