Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Sat, 15 March 2008 at 4:43 AM
Here's some sample (V4) output:
Hip - [ 1152 : 1279 ]<br></br>
---Test1 Numeric: 0.844000101089<br></br>
---Test1 Vector: 0.234999895096<br></br>
Abdomen - [ 2270 : 2362 ]<br></br>
---Test1 Numeric: 1.53100013733<br></br>
---Test1 Vector: 0.43700003624<br></br>
Chest - [ 3732 : 3914 ]<br></br>
---Test1 Numeric: 2.54699993134<br></br>
---Test1 Vector: 0.734999895096<br></br>
Neck - [ 676 : 754 ]<br></br>
---Test1 Numeric: 0.484000205994<br></br>
---Test1 Vector: 0.140999794006<br></br>
Head - [ 14022 : 15078 ]<br></br>
---Test1 Numeric: 9.81200003624<br></br>
---Test1 Vector: 2.81299996376<br></br>
etc.
...the format is:
actorname - [numpolys : numverts]
-- Numeric timing (seconds)
-- Vector timing (seconds)
...I'm not currently using numpolys, just simulating all vertices tested against 100 loops (100 polys). As mentioned earlier, the timings don't correlate to real-world linecast_loop() times, because I'm not actually testing regions or even polygons - just doing a representive number of multiplies, like so:
----------- S N I P ------------
ray = Vector(0.0, 0.1, 0.0) # a dummy vertex
normal<br></br>
pn = Vector(0.0, 0.1, 0.0) # a dummy poly normal<br></br>
intersect = 1.0 # a dummy intersection
distance<br></br>
for pi in range(100): # numPolys takes too long -
just do 100 loops<br></br>
for vi in range(numVerts):<br></br>
v = verts[vi]<br></br>
ndota = pn ^ ray # dot product<br></br>
ndotv = pn ^ v # dot product<br></br>
point = Vector(v.x + (ray.x * intersect), v.y + (ray.y
* intersect), v.z + (ray.z * intersect))
v0 = verts[0] # just
grab the first 3 verts of the mesh as a stand-in triangle<br></br>
v1 = verts[1] # for this test
(we're only concerned with how long the computations<br></br>
v2 = verts[2] # take and not
about hit results)
eu = v1 - v0 #vecsub(v1,v0)<br></br>
ev = v2 - v0 #vecsub(v2,v0)<br></br>
uu = eu ^ eu #vector_dotproduct(eu,eu)<br></br>
vv = ev ^ ev #vector_dotproduct(ev,ev)<br></br>
uv = eu ^ ev #vector_dotproduct(eu,ev)<br></br>
wx = point - v0 #vecsub(point,v0)<br></br>
wu = wx ^ eu #vector_dotproduct(wx,eu)<br></br>
wv = wx ^ ev #vector_dotproduct(wx,ev)<br></br>
# that makes up the majority of the vector multiplies
of the code, so we'll just stop here<br></br><br></br>
----------- S N I P ------------
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.