Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4599066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:29:16+00:00 2026-05-21T23:29:16+00:00

My terrain gets weird colors like this: http://tinypic.com/view.php?pic=307w421&s=7 Does anyone have any idea what

  • 0

My terrain gets weird colors like this:

http://tinypic.com/view.php?pic=307w421&s=7

Does anyone have any idea what is going wrong here?
In what area of my code (conceptually) should I look to debug this?

Update:

Its from a tutorial from my school based on: http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series1/Starting_a_project.php

We made use of the BasicEffect shader and made various parts of the engine such as: a camera, a 3d vertices terrain derived from a heigthmap, basic lighting, basic soft normals and an buffers for optimalization.

VertexPositionColorNormal Struct:

public struct VertexPositionColorNormal : IVertexType
{
    #region Field
    public Vector3 Position, Normal;
    public Color Color;

    #endregion

    #region Constructor

    public VertexPositionColorNormal(Vector3 position, Color color, Vector3 normal)
    {
        Position = position;
        Color = color;
        Normal = normal; 
    }

    #endregion

    #region properties
    
    public static VertexElement[] VertexElements =
    {
        new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
        new VertexElement(sizeof(float) * 3, VertexElementFormat.Color, VertexElementUsage.Color, 0),
        new VertexElement(sizeof(float)*3+4,VertexElementFormat.Vector3, VertexElementUsage.Normal,0),
    };

    public readonly static VertexDeclaration VertexDeclaration = new VertexDeclaration(VertexElements);

    VertexDeclaration IVertexType.VertexDeclaration
    {
        get { return VertexDeclaration; }
    }

    #endregion
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:29:17+00:00Added an answer on May 21, 2026 at 11:29 pm

    Try removing the , at the end of this line:

    new VertexElement(sizeof(float)*3+4,VertexElementFormat.Vector3, VertexElementUsage.Normal,0),

    I also noticed that you’ve added a constructor to your code but there isn’t one on Riemer’s site.

    Also, it might be easier for you to post your code somewhere as a zip file so we can take a look that way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made something like this: http://static.cmslog.com/testapp/google/terrain What I want to achieve now is terrain
I have code like this that sets the map type to Terrain View: map
I am trying to make terrain mesh, and for now got something like this:
Okay, I have some procedurally generated terrain (based loosely on http://www.swiftless.com/terraintuts.html ) Ive got
I added this polygon code from this website: http://www.geocodezip.com/v3_polygon_example_donut.html There is an issue though,
I have a terrain map which i would like to represent some data in.
I am making RTS game and whole terrain is like grid ( cells with
How do I set gmaps4rails to show Terrain view directly or by default for
I've been pondering this question awhile now... many 3d engines support advanced terrain rendering
Im trying to fit a swimming pool onto this piece of terrain. The terrain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.