delegate setting example

./delegated -P8080 SERVER={http,https} PERMIT="*:*.websocket.org:*" ./delegated -P8080 SERVER={http,https} PROXY="localhost:80:*.websocket.org,*.example.com" ./delegated -P8080 SERVER={http,https} PROXY="localhost:80:!*.websocket.org" fire…

blender to C++ exporter for vertices and normals of triangulated mesh for CULL_FACE

Modified so that the front-sides are directed in their normals. (faces's normal. not vertex's normal) import bpy def cross(u, v): return [u[1]*v[2]-u[2]*v[1], u[2]*v[0]-u[0]*v[2], u[1]*v[2]-u[2]*v[1]] def dot(u, v): return u[0]*v[0]+u[1]*v…

blender to C++ exporter for vertices and normals of triangulated mesh

If you prefer vertices/normals separated style, this is for you. import bpy ao = bpy.context.active_object lineNum = 0 f = open("Obj.cpp", "w") # vertices lineNum = 0 i = 0 l = [] f.write("GLfloat Obj::vtx_src[] = {\n") for v in ao.data.ve…

blender to C++ exporter for vertices and normals of triangulated mesh

Use in vnvnvn way with OpenGL. import bpy ao = bpy.context.active_object lineNum = 0 f = open("Obj.cpp", "w") # vertices and normals lineNum = 0 i = 0 l = [] f.write("GLfloat Obj::vtxnml_src[] = {\n") for v in ao.data.vertices: i += 1 n = …

get edges for each MeshPolygon

ao = bpy.context.active_object for p in ao.data.polygons: p for ek in p.edge_keys: ek This results like py.data.meshes['Plane'].polygons[0] (2, 3) (1, 3) (0, 1) (0, 2) bpy.data.meshes['Plane'].polygons[1] (0, 1) (1, 5) (4, 5) (0, 4) ... No…

simple text exporter of vertices for Blender Python for CPP

a small modification of the last snippet for C++. import bpy import bmesh def up(lineNum, v, f): for e in v.link_edges: ov = e.other_vert(v) if ov not in verts: verts.append(ov) lineNum = up(lineNum, ov, f) if lineNum%10 == 0: f.write("// …

simple text exporter of vertices for Blender Python

After executing main(), you can easily make use of the output on gnuplot. e.g. gnuplot> splot "file.dat" import bpy import bmesh def up(v, f): for e in v.link_edges: ov = e.other_vert(v) if ov not in verts: verts.append(ov) up(ov, f) f.wri…

When your handset requires a debugger to be attached for release version apk,

reboot the handset :

simple verts lister for Blender

Warning: This code must be executed under Edit mode. import bpy import bmesh def up(v): for e in v.link_edges: ov = e.other_vert(v) if ov not in verts: verts.append(ov) up(ov) print(v.co.x, ",", v.co.y, ",", v.co.z, "," ) def down(v): prin…

render to texture in OpenGL ES

The key is glFramebufferTexture2D in creating FBO. The image is rendered to the bound image buffer through the attachment point. /* texId[0] = texture from resource file texId[3] = texture on the fly in Frame Buffer 1 */ //////////////////…

How to sign an Android app for Google Play

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore [path]/key.keystore app-unsigned.apk keyNameAliaszipalign -v 4 app-unsigned.apk app-signed.apk

simple verts detection on a line

import bpy import bmesh obj = bpy.context.scene.objects.active m = obj.data bm = bmesh.new() bm.from_mesh(m) bm.verts.index_update() verts = [] # [6] [12] are examples firstV = bm.verts[6] secondV = bm.verts[12] verts.append(firstV) verts.…

How to Export Mesh Vertices

import bpy obj = bpy.data.objects['Plane.001'] for x in obj.data.vertices: obj.matrix_world * x.co

Depth Test vs Alpha Texture in OpenGL

While depth test enabled and overlay object has transparent-texture, underling object should be drawn first.

some error 2

It looks Wallpaper Picker doesn't create Engine...

some error 1

glBindFramebuffer(GL_READ_FRAMEBUFFER, pMyGlInfo->fboId); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, pMyGlInfo->fboId); glBindTexture(GL_TEXTURE_2D, pMyGlInfo->texId); ================================================================ 02-25 22:1…

GL test project on Eclipse with MinGW

I'm so confused in MS Windows environment...

hemisphere_saddle.py

You can twist hemisphere along x and y axis. Try rx=-1.0 (and let ry=1.0 as default), it will make a saddle. #!BPY import bpy import math def vert(n,rx,ry): yield (0.0, 0.0, 1.0) for k in range(1, n+1): theta = float(k)*math.pi/2.0/float(n…

MapVertsOnSurface_ver3.py

Dijkstra detection part is the same as dijkstra.py. If isRing is True, only verts on the shortest pathes between selected 3 verts will be mapped, otherwise all verts mapped.Now eF(evaluation function) is detachable. Choose one from distBtw…

Dijkstra.py

It takes significant time to compute. hahaha... import bmesh import math class VDijkstra: def __init__(self, vert): self.id = vert.index self.v = vert self.bestParent = None self.dist2start = float('inf') self.distances = {} # init peers s…

EnRound.py

Another version of makeRound.py.Map vertices onto a sphere with the given centre in Edit mode. The radius of sphere will be the average distance to the centre. The default centre is 3d-cursor, otherwise average(i.e. gravity) of verts.Pleas…

makeRound.py

Replace selected verts onto a circle in Edit mode. import bmesh import numpy as np def makeRound(): if bpy.ops.object.mode_set.poll(): bpy.ops.object.mode_set(mode='OBJECT', toggle=False) if bpy.ops.object.mode_set.poll(): bpy.ops.object.m…

pinch/zoom for Android Java

This humble code interpretes the distance between two pointers as the ratio. static final int NumberOfMyPointers = 2; static final float minimumDistance2object = 0.1f; static final float maximumDistance2object = 3.0f; static final float Ma…

blender exporter

import bpy import math import time import bmesh from os.path import expanduser # 2014 march 14 sphere is not yet implemented. # Inputs: # c_=cylinder, lc_=looped-cylinder, f_=frame, h_=hemisphere, l_=line, p_=pipe, r_=ribbon, s_=sphere # #…

SeamedPipe.py (includes SeamedLine)

Be aware the generated loop is incomplete. Connecting part has triangulated planes, not squared ones. (I do not know exact word for it, sorry. :( ) import math import bmesh import numpy as np ''' SeamedPipe ''' def deselect(): for x in bpy…

Saru-no-Koshikake-Broken.py

import math import bmesh def deselect(): for x in bpy.data.objects: x.select = False # bpy.ops.object.delete() # n=disks m=fins q=lenth r0=min radius, r1=max radius, s=h to w ratio def genVert(n, m, q, r0, r1, s): dR = (r1-r0)/float(n) d =…

Saru-no-Koshikake.py

import math import bmesh def deselect(): for x in bpy.data.objects: x.select = False # bpy.ops.object.delete() # n=disks m=fins q=lenth r=radius s=h to w ratio def genVert(n, m, q, r, s): d = 1.0 for i in range(n): yield(0.0, 0.0, q*float(…

detect vert-links in bmesh

# just print edges by verts for v in bm.verts: for e in v.link_edges: vv = e.other_vert(v) print(v.co, vv.co) # make verts-link list as array "xs" import bmesh ao = bpy.context.scene.objects.active m = ao.data bm = bmesh.new() bm.from_mesh…

Line 2 Window Frame Looped

# let u, v vectors on the plane. b the origin on it. # let a a point off plane. and n a normal of the plane. import sys import bmesh import numpy as np def mapOnPlane(a, b0, b1, b2): u = np.array([b1[0]-b0[0], b1[1]-b0[1], b1[2]-b0[2]]) v …

Line 2 Window Frame

# let u, v vectors on the plane. b the origin on it. # let a a point off plane. and n a normal of the plane. import sys import bmesh import numpy as np def mapOnPlane(a, b0, b1, b2): u = np.array([b1[0]-b0[0], b1[1]-b0[1], b1[2]-b0[2]]) v …