vertex

Debugging directx pixel/vertex shaders?

I'm trying to figure out how to debug pixel and vertex shaders in DirectX, I've tried using Pix for Windows but find it to be quite buggy and effectively non-operational. Is there an alternative that would allow me to debug these shaders inside my own application? ...

Can I use a vertex shader to display a models normals?

I'm currently using a VBO for the texture coordinates, normals and the vertices of a (3DS) model I'm drawing with "glDrawArrays(GL_TRIANGLES, ...);". For debugging I want to (temporarily) show the normals when drawing my model. Do I have to use immediate mode to draw each line from vert to vert+normal -OR- stuff another VBO with vert and...

Using opengl, how do I combine a background image and a smaller distorted texture?

I am attempting to make an image stretch effect on the iphone. I make a vertex array and shift the texture data for each indice within an arbitrary radius of a background image. Then make the following calls to display: int n = gridSize_.x * gridSize_.y; glEnableClientState( GL_VERTEX_ARRAY); glEnableClientState( GL_TEXTURE_COORD_ARRAY...

Cocoa and OpenGL, How do I set a GLSL vertex attribute using an array?

I'm fairly new to OpenGL, and I seem to be experiencing some difficulties. I've written a simple shader in GLSL, that is supposed to transform vertices by given joint matrices, allowing simple skeletal animation. Each vertex has a maximum of two bone influences (stored as the x and y components of a Vec2), indices and corresponding weigh...

Getting basic 3D models into an OpenGL app

Ok... I'm doing simple OpenGL ES programming and when I say simple, the most complicated things I do aren't much more than glorified beveled cubes and L-shapes. (Think very Tetris but in 3D.) However, getting all that vertex data into an app is either a) hand-coded (UGH!) or b) 3rd-party game engine (double-UGH!!!) or you use some 3rd-p...

OpenGL ES Polygon with Normals rendering (Note the 'ES!')

Ok... imagine I have a relatively simple solid that has six distinct normals but actually has close to 48 faces (8 faces per direction) and there are a LOT of shared vertices between faces. What's the most efficient way to render that in OpenGL? I know I can place the vertices in an array, then use an index array to render them, but I ...

Java OpenGL Vertex Buffer Objects not working

I tried to implement Open GLs Vertex Buffer Objects the first time, and all i get is a black screen. I tried it with glOrtho instead of glPerspective, but it didnt work as well. thanks for helping Heres my code: public class VBufferTest { public static final int WIN_WIDTH = 640; public static final int WIN_HEIGHT = 480; public in...

Opengl ES - drawing a plane of multiple vertices

Hi Using Opengl ES for Anroid we’re facing a problem when drawing a square with a texture. They look fine from a distance, but when getting close to the model the texture screws up. We believe this is caused by the fact that the model only consists of four vertices: float[] coords = { -1, 1, 0.0f, 1, 1, 0.0f, -1, -1, 0.0f, 1, -1, ...

I'm having an issue to use GLshort for representing Vertex, and Normal.

As my project gets close to optimization stage, I notice that reducing Vertex Metadata could vastly improve the performance of 3D rendering. Eventually, I've dearly searched around and have found following advices from stackoverflow. Using GL_SHORT instead of GL_FLOAT in an OpenGL ES vertex array How do you represent a normal or textu...

Is the binormal of a vertex the cross between its normal and tangent?

I'm trying to find out what a binormal is in the context of graphics programming but coming up short, I saw on a site that the binormal was being calculated as the corss between the normal and tangent (i.e. cross(normal, tangent)), is this the correct way to calculate a binormal? ...

Transformed vertex after reflection over the x-axis

A figure has a vertex (x, -y). What are the coordinates of the transformed vertes after a reflection over the x-axis? ...

When should I use indexed arrays of OpenGL vertices?

I'm trying to get a clear idea of when I should be using indexed arrays of OpenGL vertices, drawn with gl[Multi]DrawElements and the like, versus when I should simply use contiguous arrays of vertices, drawn with gl[Multi]DrawArrays. (Update: The consensus in the replies I got is that one should always be using indexed vertices.) I hav...

Minimum vs Minimal vertex covers

I am studying for an exam and one of the sample questions is as follows: Vertex cover: a vertex cover in a graph is a set of vertices such that each edge has at least one of its two end points in this set. Minimum vertex cover: a MINIMUM vertex cover in a graph is a vertex cover that has the smallest number of vertices among all possib...

How to set up the arrays for glDrawElemetnts (OpenGL ES iPhone)?

How to wire up the values for glDrawElements? I need a simple textured square example (2 face, normals, textCoords, nothin' more). I tried to do it (the arrays at glDrawArrays implementation works fine, but something went wrong when I create the indices and all), but the screen was empty. Please shed me a light, I've googled the whole ...

Position of the vertex in Box2d

Hi How can i get position of the vertex in box2d ...

Xna 4.0 3D Vertex example

Hello, I'm currently trying to make a simple square by combining two triangles, like in the tutorials by Riemer (Link to tutorial), but since a lot has changed from 3.x to 4.0, I find it difficult. I would also like to know how to texture this "square", so if anyone could help me by giving some example or whatsoever, I would appreciate ...

edge sequence by vertex name

Hy Everybody! Well, I'm working with the Igraph package, and i'd like to pick the edges by the name that I've assigned to their vertex, in a tiny example.. library(igraph) g <- barabasi.game(8) labels<-c("G1","G2","G3","T1","T2","T3","H1","H2") V(g)$name<-labels Now My edge list hast this form > E(g) Edge sequence: [0] G2 ->...

Problem with shader/code

I have this basic 3d application and trying to write my own toon shader, but even if I remove the tooning part it still still just stays plain darkblue when I give a red color to it. shader code : struct VertexShaderInput { float4 Position : POSITION0; float3 Normal : NORMAL0; float4 Color : COLOR0; }; struct VertexShader...