comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Color behavior when using TEXTURE MAP
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Color behavior when using TEXTURE MAP [message #42325] Tue, 01 February 2005 08:25
robertschaefer is currently offline  robertschaefer
Messages: 10
Registered: August 2004
Junior Member
;Hello, try this code, i think it may help.
;s should be the opaque white obj. in the creation
;with idlgrpolygon you can set the color.
;attend the values in "image" for red, green and blue you
;have to set 255

; create 2 simple objects

vol=bytarr(10,10,10)
vol[1:8,1:8,1:8]=1

vol2=bytarr(10,10,10)
vol2[3:5,3:5,3:5]=1

isosurface, vol, 1, v, c
s=obj_new('IDLgrPolygon', v, polygons=c, $
color=[255b,255b,255b],shading=1)

isosurface, vol2, 1, v, c
r=obj_new('IDLgrPolygon', v, polygons=c, $
color=[0b,0b,255b],shading=1)


; create Alphachannel, you can choose from 0-255,
; 0 is completly opaque

image=BYTARR(4,256,256)
image[0,*,*]=REPLICATE(255b,256,256) ; red channel
image[1,*,*]=REPLICATE(255b,256,256) ; green channel
image[2,*,*]=REPLICATE(255b,256,256) ; blue channel
image[3,*,*]=REPLICATE(30,256,256) ; alpha channel
;image[3,*,*]=REPLICATE(200,256,256) ; alpha channel

; change the greyvalues to understand how it works

;image=BYTARR(4,256,256)
;image[0,*,*]=REPLICATE(255b,256,256) ; red channel
;image[1,*,*]=REPLICATE(0b,256,256) ; green channel
;image[2,*,*]=REPLICATE(0b,256,256) ; blue channel
;image[3,*,*]=REPLICATE(30,256,256) ; alpha channel
;
;image=BYTARR(4,256,256)
;image[0,*,*]=REPLICATE(0b,256,256) ; red channel
;image[1,*,*]=REPLICATE(0b,256,256) ; green channel
;image[2,*,*]=REPLICATE(255b,256,256) ; blue channel
;image[3,*,*]=REPLICATE(30,256,256) ; alpha channel

; create imageobj

oimage=OBJ_NEW('IDLgrIMAGE',image, INTERLEAVE=0, BLEND_FUNCTION=[3,4])

; set texture map to obj

s->setproperty,texture_map=oimage

; create model obj

theModel = Obj_New('IDLgrModel')

; add opaque and transparent obj to model

themodel->add,r
themodel->add,s

xobjview,theModel,/block
obj_destroy,themodel


end



;best regards, Robert
[Message index]
 
Read Message
Previous Topic: Re: _extra and call_method
Next Topic: NULL value in IDL ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 14:44:44 PDT 2025

Total time taken to generate the page: 0.88087 seconds