Texture coordinate mapping how to map coordinates of 4 triangles in a square to 4 triangles in a triangle
By : B.G.
Date : March 29 2020, 07:55 AM
Hope this helps Let's consider first the case of the triangle a. Assuming that your origin is at point 5, the coordinates of points 1 and 2 are (x0, y0) and (x0, y0), we should have the following. code :
xnew = A*x + B*y + C
ynew = D*x + E*y + F
x0 = A*x0 + B*y0 + C (1) x0/2 = A*x0 + B*y0 + C (3)
y0 = D*x0 + E*y0 + F (2) y0 = D*x0 + E*y0 + F (4)
0 = A*0 + B*0 + C (5)
y0 = D*0 + E*0 + F (6)
xnew = 0.25*x  0.75*(x0/y0)*y
ynew = 2*y  y0
xnew = 0.25*x  0.25*(x0/y0)*y
ynew = 2*y  y0

Is it possible to make CSS triangles / arrows that aren't your typical right angled triangles with a gradient applied?
By : Dirk van Blokland
Date : March 29 2020, 07:55 AM
This might help you I know that to create a basic arrow in CSS I can do this: , You can use skew for making triangle of 120 degree like this: code :
.arrowtip {
display:block;
width:50px;
height:50px;
margin:0 0 0 20px;
webkittransform:rotate(45deg) skew(20deg,20deg);
}

Print any number of triangles of a given size  Output Prints Extra Trailing White Spaces
By : user2775085
Date : March 29 2020, 07:55 AM

Best method to rotate triangles such that there is no gap between top and bottom line triangles after a full rotation?
By : user3710797
Date : March 29 2020, 07:55 AM
I wish this help you Add a straight line at the at the bin and the end of the data. Compute the minimum and the maximum of the original data, the y scale of the data and the average offset from one line to another: code :
origshape = self.e.shape[:]
origmin, origmax = self.e[0, :, 1].max(), self.e[1, :, 1].min()
origsize = origmax  origmin
origoffset = origsize / origshape[0]
newmin, newmax = origmin  origoffset/2, origmax + origoffset/2
self.first = self.e[0,:,:].copy().reshape((1, *origshape[1:]))
self.last = self.e[1,:,:].copy().reshape((1, *origshape[1:]))
self.first[:,:,1] = newmax
self.last[:,:,1] = newmin
self.e = np.concatenate((self.first, self.e, self.last))
class GLPlotWidget(QGLWidget):
def __init__(self, *args):
super(GLPlotWidget, self).__init__()
self.width, self.height = 100, 100
self.we = np.load('two.npy', mmap_mode='r')
self.e = copy.deepcopy(self.we[:, :, :])
origshape = self.e.shape[:]
origmin, origmax = self.e[1, :, 1].min(), self.e[1, :, 1].max()
origsize = origmax  origmin
origoffset = origsize / origshape[0]
newmin, newmax = origmin  origoffset/2, origmax + origoffset/2
self.first = self.e[0,:,:].copy().reshape((1, *origshape[1:]))
self.last = self.e[1,:,:].copy().reshape((1, *origshape[1:]))
self.first[:,:,1] = newmax
self.last[:,:,1] = newmin
self.e = np.concatenate((self.first, self.e, self.last))
self.right, self.left, self.top, self.bottom = self.e[0, 1, 0], self.e[
0, 0, 0], self.e[0, :, 1].max(), self.e[1, :, 1].min()
self.vbo = glvbo.VBO(self.e)
self.count = self.vbo.shape[1]
self.scroll = 0
self.number_of_arm = 24
self.linerange = [(self.e[li, :, 1].max(), self.e[li, :, 1].min()) for li in range(self.vbo.shape[0])]
self.showMaximized()

Drawing Simple Triangles in 3D.. Only one shows up on Emulator, on real device  No Triangles
By : Divya
Date : March 29 2020, 07:55 AM
I hope this helps . Your shaders should not compile on ES2. According to the GLES Shading Language 1.0.17 spec (which is relevant for ES2.0), there are no layout qualifiers, and there is no in/out (just like with GLSL <=1.20 on desktop GL), but you have to use attribute for vertex shader inputs and varying for communication between vertex and fragment shader. You have to use glBindAttribLocation before linking the program to assign the attribute indices to your shader inputs (or query the ones the GL assigned if you do not specify them).

