Jump to content
  • Advertisement
Josheir

3D Hill Data is Strange to me

Recommended Posts

Posted (edited)

I am trying to visualize if the attached diagram of data of triangles is correct for the attached hill image.  I used a nested for loop to find all triangles with any vertices having a height greater than zero.  The two triangles marked with an X surprisingly have no height values and the shape of the triangles is odd to me.  The triangles marked with A are left triangles and the triangles marked with B are right triangles.  The rendering was done in OpenGL with C++, and the X coordinates and  Z coordinates are by convention.  

The one point with a height is shown here:

 

void addHillsManually()
{
	
	heightMapFromArray[20][20] = .5;
}

Thank you,

Josheir

Scan_Pic0007.jpg

hill.jpg

Edited by Josheir

Share this post


Link to post
Share on other sites
Advertisement

Do you know blender or another modeling package? Create what you have and see the effects of pulling the center vert up. It's the best way for you to see what is happening.

Share this post


Link to post
Share on other sites

What exactly looks strange to you? Assuming that the thick point in the center is the only point with elevation, the result looks perfectly correct and according to the diagram to me.

Share this post


Link to post
Share on other sites
2 minutes ago, wurstbrot said:

What exactly looks strange to you? Assuming that the thick point in the center is the only point with elevation, the result looks perfectly correct and according to the diagram to me.

Yeah I was kind of thinking that too, but then I thought maybe there are other vertexes that are supposed to be higher also.

Share this post


Link to post
Share on other sites
8 hours ago, wurstbrot said:

What exactly looks strange to you? Assuming that the thick point in the center is the only point with elevation, the result looks perfectly correct and according to the diagram to me.

That's not correct. The top right diagonal and bottom left diagonal would need to be flipped for that result.

Share this post


Link to post
Share on other sites
11 hours ago, wurstbrot said:

What exactly looks strange to you? Assuming that the thick point in the center is the only point with elevation, the result looks perfectly correct and according to the diagram to me. 

It looked asymmetrical,with a point in the center I thought that the triangles marked X would also have height. I am now seeing that the image's B3 is smaller than the combined A3 and B2.  Just so I get it, the total area of B3 is now half that of the combination of A3 and B2.  It's very hard to explain but I think I am seeing it right now.

And for a symmetrical hill I should use the attached image's design.

Are these right?

Thank you.

Josheir

Scan_Pic0008.jpg

Share this post


Link to post
Share on other sites
17 hours ago, fleabay said:

That's not correct. The top right diagonal and bottom left diagonal would need to be flipped for that result.

What do you mean? The 3D image shows exactly what one expects from the 2D drawing.

 

@Josheir

With the geometry on the new diagram, you'll get a pyramid with a square base.

In the end, it depends on what you want, of course. But in any case, your code appears to work correctly. If it does not do what you want, then you're not telling it what you want ;).

 

 

Share this post


Link to post
Share on other sites

This is what the original mesh looks like when center vert is pulled up. It doesn't look like the desired output IMO.

nv7ifr.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!