Jump to content

Need help with C#

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Georgeman

Georgeman

    Newbie

  • Members
  • Pip
  • 6 posts
I am receiving a error when trying to Convert a height map into a 3d landscape using c#. I have managed to get the height map into a matrix with a wireframe I am also able to colour sections depending on height. The issue is that I am so far unable to add textures to the landscape like grass, snow and water etc.

These are the errors

"The current vertex declaration does not include all the elements required by the current vertex shader. Normal0 is missing."

And also

"DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3, VertexPositionColor.VertexDeclaration);"

So any help is appreciated.

#2
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Would need to know what graphics API you're using, and the part of your source code that's producing the error.

#3
Georgeman

Georgeman

    Newbie

  • Members
  • Pip
  • 6 posts
Will do so.

Here you go

  {

                 pass.Apply();

 

                 device.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, indices, 0, indices.Length / 3, VertexPositionColor.VertexDeclaration);

             }

 

             base.Draw(gameTime);

Posted Image

Edited by Georgeman, 08 March 2011 - 10:41 AM.


#4
Georgeman

Georgeman

    Newbie

  • Members
  • Pip
  • 6 posts
EDIT = Made two posts by mistake.

Edited by Georgeman, 08 March 2011 - 12:51 PM.


#5
Georgeman

Georgeman

    Newbie

  • Members
  • Pip
  • 6 posts
Gamefront For you all to see for yourself and help understand the issue at hand,

Please note this is not to be used in any other project :)

#6
Tonchi

Tonchi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 471 posts
  • Location:Varaždin
  • Programming Language:C, C++, C#
hello again...i need a help...i want to upgrade my program with cell controlling...i have xml file and i'm reading that file into datagridview control so i have columns that i have defined in xml file...what i want is to make sure that user enters a valid value in some cell...if some column must contain character value (not numeric or something else) and user enters wrong value program must display text message like "wrong input" and program must erase everything that user enters in that cell with error




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users