POV-Ray : Newsgroups : povray.general : How do I construct an object pointer? Server Time
7 Nov 2024 17:28:26 EST (-0500)
  How do I construct an object pointer? (Message 1 to 3 of 3)  
From: Tom Melly
Subject: How do I construct an object pointer?
Date: 21 Jan 2002 08:25:55
Message: <3c4c16e3$1@news.povray.org>
If I have 2 objects, MyMesh1 and MyMesh2,

How can I write

#local ThisMesh = concat("MyMesh", str(1,0,0))

so that it works?

--
#macro G(D,E,F)#local I=array[3]{D,E,F}#local B=0;triangle{#while(
B<3)#while(I[B])A[mod(I[B],10)]+#local I[B]=div(I[B],10);#end<-5,-
2,9>#local B=B+1;#end}#end #local A=array[7]{x,x*2,x*4,y,y*2,y*4,z
}light_source{-x*6-z*9,1}mesh{G(105,10,146)G(105,246,10)G(105,56,
146)G(105,1256,246)G(1256,126,220)G(22156,2216,201)pigment{rgb 1}}//TM


Post a reply to this message

From: Tom Melly
Subject: Re: How do I construct an object pointer?
Date: 21 Jan 2002 08:44:09
Message: <3c4c1b29$1@news.povray.org>
"Tom Melly" <tom### [at] tomandlucouk> wrote in message
news:3c4c16e3$1@news.povray.org...
> If I have 2 objects, MyMesh1 and MyMesh2,

<snip>

S'allright - figured it out (well, switched to array)

So:

#local TreeArray = array[2]
#local TreeArray[0] = object{MyMesh1}
#local TreeArray[1] = object{MyMesh2}
#local ThisTree = int(rand(Rand1) + 0.5);
object{TreeArray[ThisTree]}


Post a reply to this message

From: Peter Popov
Subject: Re: How do I construct an object pointer?
Date: 22 Jan 2002 19:42:06
Message: <gg1s4u0ujldnovauhtjpcnhhh1cpgpfjb2@4ax.com>
On Mon, 21 Jan 2002 13:25:53 -0000, "Tom Melly" <tom### [at] tomandlucouk>
wrote:

>If I have 2 objects, MyMesh1 and MyMesh2,
>How can I write
>#local ThisMesh = concat("MyMesh", str(1,0,0))
>so that it works?

Output to file, then include the file where you need it. You can do it
as a macro. Better yet, grab the macro from the scene-files groups
(it's there :) ).


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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