Try this code and tell me if it works on your machine:
from pandac.PandaModules import *
import direct.directbase.DirectStart
import random
base.setBackgroundColor(0,0,0,1)
def pointCube(amount, size, pointsize = 0.01):
# create vertices
format = GeomVertexFormat.getV3c4() # position and texcoord
vdata = GeomVertexData('vdata', format, Geom.UHStatic)
vwriter = GeomVertexWriter(vdata, 'vertex')
colorwriter = GeomVertexWriter(vdata, 'color')
# GeomPoints primitive
geompoints = GeomPoints(Geom.UHStatic)
index = 0
for i in range(amount):
# random positions in range (-1,1)
vwriter.addData3f(random.uniform(-1.0, 1.0), random.uniform(-1.0, 1.0), random.uniform(-1.0, 1.0))
# random UVs
colorwriter.addData4f(random.random(), random.random(), random.random(), 1)
# add to GeomPoints
geompoints.addVertex(index)
geompoints.closePrimitive()
index += 1
# create GeomNode and put it in NodePath
geom = Geom(vdata)
geom.addPrimitive(geompoints)
gnode = GeomNode('starfield')
gnode.addGeom(geom)
nodepath = NodePath(gnode)
nodepath.setRenderMode(RenderModeAttrib.MPoint, pointsize)
return nodepath
pointcube1 = pointCube(2000,100, 0.05)
pointcube1.reparentTo(render)
pointcube2 = pointCube(1000,100, 4)
pointcube2.reparentTo(render)
#pointcube1.setRenderModePerspective(True)
#pointcube2.setRenderModePerspective(True)
run()
When I uncomment the first line of the last two lines, the vertices are rendered considerably bigger and in non-perspective, then after usually few seconds they change from persective to non-perpective in short intervals until they are finally rendered in persepctive. When I have two NodePaths like this (by uncommenting the second line as well), they are both rendered in non-perspective, alot bigger than they should be and after few seconds Panda freezes.
Tell me if you get this issue as well.