POV-Ray : Newsgroups : povray.binaries.images : Second preview of tesselation patch Server Time
19 Aug 2024 10:21:54 EDT (-0400)
  Second preview of tesselation patch (Message 1 to 5 of 5)  
From: Warp
Subject: Second preview of tesselation patch
Date: 13 Dec 2000 14:50:18
Message: <3a37d2f8@news.povray.org>
This scene demonstrates how the patches can be used to create a PCM file
from a mesh (which is created by tesselating an object).

  It would be possible to create only the hairs with the pcmhair macro and
then apply the hairs to the original object.


#macro ExportToPCM(Mesh, FileName)
  #fopen OutFile FileName write
  #local vrt_cnt = get_vertex_count(Mesh);
  #local nrm_cnt = get_normal_count(Mesh);
  #write(OutFile, "\"PCM1\",\n", vrt_cnt+nrm_cnt, ",\n")
  #local VInd = 0;
  #while(VInd < vrt_cnt)
    #local V = get_vertex(Mesh, VInd);
    #write(OutFile, V.x, ",", V.y, ",", V.z, ",")
    #local VInd = VInd+1;
  #end
  #local NInd = 0;
  #while(NInd < nrm_cnt)
    #local N = get_normal(Mesh, NInd);
    #write(OutFile, N.x, ",", N.y, ",", N.z, ",")
    #local NInd = NInd+1;
  #end
  #local tr_cnt = get_triangle_count(Mesh);
  #write(OutFile, "\n0,", tr_cnt, ",\n")
  #local TInd = 0;
  #while(TInd < tr_cnt)
    #local Ind1 = get_vertex_indices(Mesh, TInd);
    #local Ind2 = vrt_cnt + get_normal_indices(Mesh, TInd);
    #write(OutFile,
      Ind1.x, ",", Ind2.x, ",",
      Ind1.y, ",", Ind2.y, ",",
      Ind1.z, ",", Ind2.z, ",")
    #local TInd = TInd+1;
  #end
  #fclose OutFile
#end


#include "pcmhair.mcr"

background { rgb z*.5 }
#default { pigment { rgb <1,1,0> } finish { specular .5 } }

#declare Obj =
  union
  { sphere { y,.5 }
    cylinder { y,-y*.5,.25 }
    sphere { -y*.5,.25 }
    cylinder { y*.5, -x*.6, .2 }
    sphere { -x*.6, .2 }
    cylinder { y*.5, x*.6, .2 }
    sphere { x*.6, .2 }
    cylinder { -y*.5, -x*.4-y, .2 }
    sphere { -x*.4-y, .2 }
    cylinder { -y*.5, x*.4-y, .2 }
    sphere { x*.4-y, .2 }
  }

#declare Mesh = tesselate(Obj, 30, yes)
ExportToPCM(Mesh, "test.pcm")

object { Mesh translate -x }

#declare hair_length = .1;
#declare hair_thickness = .01;
#declare hair_objects_per_unit = 200;
#declare hair_patch_size = 0.1;
#declare hair_rotate_to_surface = true;
object { read_mesh("test.pcm") translate x }

camera { location <0,2,-13>/2 look_at y*.2 angle 35 }
light_source { <200,100,-150>, 1 }
light_source { <-200,100,-100>, x*.5 }


Post a reply to this message


Attachments:
Download 'tesselationtest2.jpg' (137 KB)

Preview of image 'tesselationtest2.jpg'
tesselationtest2.jpg


 

From: Kevin Ellis
Subject: Re: Second preview of tesselation patch
Date: 13 Dec 2000 17:45:01
Message: <3a37fbed@news.povray.org>
This looks like it is going to be an extremely useful patch. I eagerly await
the release, although I realise it could be a while, but at least I can come
up with a few ideas first. Superb work.

Kev

http://web.libertysurf.co.uk/kevin.ellis


Post a reply to this message

From: Steve
Subject: Re: Second preview of tesselation patch
Date: 13 Dec 2000 19:14:30
Message: <slrn93g2k3.mmm.steve@zero-pps.localdomain>
Both this and the previous image are interesting, but could
you give a more general explanation of what the patch does?

-- 
Cheers
Steve              email mailto:ste### [at] zeroppsuklinuxnet

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

 11:43pm  up 64 days,  2:08,  3 users,  load average: 1.01, 1.08, 1.04


Post a reply to this message

From: Tony[B]
Subject: Re: Second preview of tesselation patch
Date: 13 Dec 2000 23:58:48
Message: <3a385388@news.povray.org>
>   It would be possible to create only the hairs with the pcmhair macro and
> then apply the hairs to the original object.

I like the way you think. :)


Post a reply to this message

From: Mick Hazelgrove
Subject: Re: Second preview of tesselation patch
Date: 14 Dec 2000 03:14:34
Message: <3a38816a@news.povray.org>
I can't wait to get my hands on this patch. The possibilities are endless,
great stuff.

An eagerly waiting

Mick


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.