POV-Ray : Newsgroups : povray.binaries.images : See post entitled "texturing in CSG" [2 * 4Kbu] Server Time
18 Aug 2024 16:19:58 EDT (-0400)
  See post entitled "texturing in CSG" [2 * 4Kbu] (Message 1 to 8 of 8)  
From: Francois Labreque
Subject: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 26 Mar 2001 20:15:52
Message: <3ABFE8FE.6807923E@videotron.ca>
in povray.unofficial.patches

test.jpg - done in POV-Ray 3.1g For Windows
test2.jpg - done in MegaPOV 0.7 for Windows



-- 
Francois Labreque | The surest sign of the existence of extra-
    flabreque     | terrestrial intelligence is that they never
        @         | bothered to come down here and visit us!
  videotron.ca    |                             - Calvin


Post a reply to this message


Attachments:
Download 'test2.jpg' (4 KB) Download 'test.jpg' (4 KB)

Preview of image 'test2.jpg'
test2.jpg

Preview of image 'test.jpg'
test.jpg


 

From: Wlodzimierz ABX Skiba
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 06:48:09
Message: <3ac07df9@news.povray.org>
Francois Labreque wrote in message <3ABFE8FE.6807923E@videotron.ca>...
> in povray.unofficial.patches
>
> test.jpg - done in POV-Ray 3.1g For Windows
> test2.jpg - done in MegaPOV 0.7 for Windows


thanks for effort but try this:

// ============= START

#include "modeling.inc" // whats that ? see description at end of post

#declare SzaryStalowy=texture{pigment{granite color_map{[0 color rgb 0.5][1
color rgb 1]}}finish{ambient 0}scale 5}
#declare Czarny=texture{pigment{color rgb 0}finish{ambient 0}}

#macro RPolygon(P1,P2,P3,P4)
  triangle{ P1 P2 P3 }
  triangle{ P3 P4 P1 }
#end

#macro RHalfBox(P1,P2)
  RPolygon(P1,<P1.x,P1.y,P2.z>,<P1.x,P2.y,P2.z>,<P1.x,P2.y,P1.z>)
  RPolygon(P1,<P2.x,P1.y,P1.z>,<P2.x,P2.y,P1.z>,<P1.x,P2.y,P1.z>)
  RPolygon(P1,<P2.x,P1.y,P1.z>,<P2.x,P1.y,P2.z>,<P1.x,P1.y,P2.z>)
#end

#macro RBox(P1,P2)
  RHalfBox(P1,P2)
  RHalfBox(P2,P1)
#end

#macro RCoffer(LOD,X,Y,Z,H,D,T,L,M,R)
  #if(LOD)
    union{
      mesh{
        RBox(<-X/2,H,-Z/2>,<X/2,H+Y,Z/2>)
        #if(H>0)
          RBox(<-(T+D/2),0,T-Z/2>,<-D/2,H,Z/2-T>)
          RBox(<D/2,0,T-Z/2>,<T+D/2,H,Z/2-T>)
        #end

RPolygon(<-X/2,H+Y-M,R+Z/2>,<X/2,H+Y-M,R+Z/2>,<X/2,H+Y,Z/2>,<-X/2,H+Y,Z/2>)

RPolygon(<-(R+X/2),H+Y-M,M-Z/2>,<-(R+X/2),H+Y-M,Z/2>,<-X/2,H+Y,Z/2>,<-X/2,H+Y,-Z
/2>)

RPolygon(<R+X/2,H+Y-M,M-Z/2>,<R+X/2,H+Y-M,Z/2>,<X/2,H+Y,Z/2>,<X/2,H+Y,-Z/2>)
        texture{SzaryStalowy}
      }
      #local P1=<-L/2,H+Y-M/2,Z/2>;
      #local P2=<-L/2,H+Y-M/2,M+Z/2>;
      #local P3=<L/2,H+Y-M/2,M+Z/2>;
      #local P4=<L/2,H+Y-M/2,Z/2>;
      cylinder{P1 P2 R}
      sphere{P2 R}
      cylinder{P2 P3 R}
      sphere{P3 R}
      cylinder{P3 P4 R}
      texture{Czarny}
    }
  #else
    mesh{
      RBox(<-X/2,H,-Z/2>,<X/2,H+Y,Z/2>)
      texture{SzaryStalowy}
    }
  #end
#end

#macro R175(LOD,W175,D175)
  #if(!defined(R175Ready))
    #local X=W175;
    #local Y=1;
    #local Z=D175;
    #local H=0;
    #local D=0;
    #local T=0.15;
    #local L=0.3;
    #local M=0.1;
    #local R=T/10;
    #declare R175Ready=RCoffer(LOD,X,Y,Z,H,D,T,L,M,R)
  #end
  R175Ready
#end

#declare Model=R175(HighLOD,0.875,0.5)
#declare Model=object{Model rotate -x*90 texture{SzaryStalowy}}
display_project(Model,0.1,0,3,color rgb 0)

// ============= END

where macro display_project was sended as "modeling enviroment without modeler"
to p.b.utilities as modeling.inc
as attachement here it is output of this object

shouldn't be handle black ?

ABX


Post a reply to this message


Attachments:
Download 'r.png' (34 KB)

Preview of image 'r.png'
r.png


 

From: Francois Labreque
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 08:09:19
Message: <3AC09032.2A10EF45@videotron.ca>
Wlodzimierz ABX Skiba wrote:

> #declare Model=R175(HighLOD,0.875,0.5)
> #declare Model=object{Model rotate -x*90 texture{SzaryStalowy}}
                                           ^^^^^^^^^^^^^^^^^^^^^

Comment this out and it clears your problem.  I have no explanantion as
to why it would override your handle's texture but not my sphere's, but
you are re-associating a texture to an object that already has one.

-- 
Francois Labreque | The surest sign of the existence of extra-
    flabreque     | terrestrial intelligence is that they never
        @         | bothered to come down here and visit us!
  videotron.ca    |                             - Calvin


Post a reply to this message


Attachments:
Download 'test.jpg' (3 KB)

Preview of image 'test.jpg'
test.jpg


 

From: Francois Labreque
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 08:15:56
Message: <3AC091BF.A0D5C49D@videotron.ca>
Eureka!

Francois Labreque wrote:
> 
> Wlodzimierz ABX Skiba wrote:
> 
> > #declare Model=R175(HighLOD,0.875,0.5)
> > #declare Model=object{Model rotate -x*90 texture{SzaryStalowy}}
>                                            ^^^^^^^^^^^^^^^^^^^^^
> 
> Comment this out and it clears your problem.  I have no explanantion as
> to why it would override your handle's texture but not my sphere's, but
> you are re-associating a texture to an object that already has one.

It happens because R175 is a macro and macros are expanded before
parsing, so the line becomes

#declare Model=object{ union{obj1 obj2 obj3 ...} tex1 trans1
texture(SzaryStalowy)}

Which is just an object with a layered textures.  Since SzaryStalowy is
not transparent, the whole box becomes gray.

Quod Erat Demonstrandum.

> 
> --
> Francois Labreque | The surest sign of the existence of extra-
>     flabreque     | terrestrial intelligence is that they never
>         @         | bothered to come down here and visit us!
>   videotron.ca    |                             - Calvin
> 
>   ------------------------------------------------------------------------
>  [Image]

-- 
Francois Labreque | The surest sign of the existence of extra-
    flabreque     | terrestrial intelligence is that they never
        @         | bothered to come down here and visit us!
  videotron.ca    |                             - Calvin


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 09:29:13
Message: <3ac0a3b9$1@news.povray.org>
Francois Labreque wrote in message <3AC09032.2A10EF45@videotron.ca>...
> > #declare Model=R175(HighLOD,0.875,0.5)
> > #declare Model=object{Model rotate -x*90 texture{SzaryStalowy}}
>                                           ^^^^^^^^^^^^^^^^^^^^^
> Comment this out and it clears your problem.  I have no explanantion as
> to why it would override your handle's texture but not my sphere's, but
> you are re-associating a texture to an object that already has one.


are you sure that when you comment texture{} it is my black or default black ?

ABX


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 09:39:19
Message: <3ac0a617$1@news.povray.org>
Francois Labreque wrote in message <3AC091BF.A0D5C49D@videotron.ca>...
> Eureka!
>
> It happens because R175 is a macro and macros are expanded before
> parsing, so the line becomes
>
> #declare Model=object{ union{obj1 obj2 obj3 ...} tex1 trans1
> texture(SzaryStalowy)}
>
> Which is just an object with a layered textures.  Since SzaryStalowy is
> not transparent, the whole box becomes gray.

not exactly
R175 is macro but inside it first create object to variable and than return
declared variable

I think there is still no answer :-(

ABX


Post a reply to this message

From: Francois Labreque
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 09:41:10
Message: <3AC0A5B9.1948E1B4@videotron.ca>
Wlodzimierz ABX Skiba wrote:
> 
> are you sure that when you comment texture{} it is my black or default black ?

It is "your" black.  See below:


-- 
Francois Labreque | The surest sign of the existence of extra-
    flabreque     | terrestrial intelligence is that they never
        @         | bothered to come down here and visit us!
  videotron.ca    |                             - Calvin


Post a reply to this message


Attachments:
Download 'test.jpg' (4 KB)

Preview of image 'test.jpg'
test.jpg


 

From: Wlodzimierz ABX Skiba
Subject: Re: See post entitled "texturing in CSG" [2 * 4Kbu]
Date: 27 Mar 2001 11:23:49
Message: <3ac0be95@news.povray.org>
Francois Labreque wrote in message <3AC0A5B9.1948E1B4@videotron.ca>...
> > are you sure that when you comment texture{} it is my black or default black
?
>
> It is "your" black.  See below:


now it is complatly strange for me becouse in my real scene it appears also with
"my" black without removing texture{}

I mean this works IMO wrong way:
  #declare Model=R175(...)
  #declare Model=object{Model rotate ... texture{Gray}}
this works fine:
  #declare Part=R175(...)
  #declare Model=union{ .... object{Part trasnform} .... }
  #declare Model=object{Model rotate ... texture{Gray}}

see below - code for R175 not changed

ABX


Post a reply to this message


Attachments:
Download 's.png' (7 KB)

Preview of image 's.png'
s.png


 

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