• Create Account

# MarkS

Member Since 09 Jan 2001
Offline Last Active Today, 02:47 AM

### In Topic: Drawing solid triangle

Yesterday, 03:46 PM

It isn't that I don't want to help, but this is a topic that is older than I am and I'll be 40 in March. Doctoral thesis were written on this subject up through the '90s. I would recommend you break this down into parts and try to solve each part. How would you scan convert a triangle with a flat bottom vs. a flat top vs. a general triangle? What tests would you need to perform? How should your code change?

I found multiple examples on Google in seconds, but I strongly recommend you not go this route. It is simple math and you're already part way there.

### In Topic: Drawing solid triangle

Yesterday, 12:01 AM

Your rasterizer only work so long as x0,y0 is at the top. Your code doesn't take the case of a horizontal top edge into consideration and fails at this point. This is why your cube is only being rendered as right triangles with the apex at the top.

### In Topic: Where is my Geometry Shader broken?

24 October 2016 - 10:08 PM

I changed the code in the post to make it more readable, so it could have been either. I ended up re-writing the shaders from scratch and that fixed it. Thanks heaps for taking a look.

Care to elaborate for those looking for the same answer?

### In Topic: Where is my Geometry Shader broken?

24 October 2016 - 05:43 AM

```precision lowp float;

layout(location = 0) in vec3 in_position;

uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;

out vec4 geom_position; <-- geom_position != geom_v_position

void main()
{
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_position, 1.0);
geom_v_position  = viewMatrix * modelMatrix * vec4(in_position, 1.0); <-- geom_v_position != geom_position
}
```

Is that a typo in the post or in your code? If this is in your code, you need to be checking for shader errors while compiling the shaders.

### In Topic: Compiling GTK+ in Visual Studio?

22 October 2016 - 06:47 PM

Mods, this can be closed? There really is no good answer but to learn Linux development. Either that, or trial and error setting up a new VS project, throwing hundreds of files at it and seeing what sticks.

Since this is just a hobby for my anyway, I've decided to take up Linux programming in earnest. This thread really serves no useful purpose.

PARTNERS