magost
10-12-2008, 09:04 PM
Hi all
I have a little problem with the Volume select modifier as i said on the title. First of all i will explain you what i'm trying to do in order to know if there's a better solution.
I want to remove all the faces of an object that do not appears on camera.
First of all i simulate the camera view with a pyramid aligned to the camera object. I don't know the exact size so i have to guess (there's any way to know the exact size of the camera view for doing a pyramid with those values?)
After that i add a volume select modifier for knowing the faces that lay inside that pyramid in order to remove the others.
The problem i have is that the faces that lay inside of the pyramid i use as mesh object are not selected. If i do it by hand it works fine but it does not happend the same if i use scripting. Someone does know the reason?
Thanks in advance for your help!
The code i'm using is this:
obj = box lengthsegs:10 widthsegs:10 heightsegs:10
camPyr=Pyramid width:120 depth:80 height:165
camPyr.pivot = [camPyr.pos.x, camPyr.pos.y, camPyr.pos.z+camPyr.height]
cam = Freecamera fov:45 targetDistance:160 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off transform:(matrix3 [0,-1,0] [0,0,1] [-1,0,0] [-165.639,-2.75248,0])
ResetXForm camPyr
camPyr.transform = cam.transform
addModifier obj (volumeselect level:2 type:1 volume:3 node:camPyr)
addModifier obj (edit_Mesh())
I have a little problem with the Volume select modifier as i said on the title. First of all i will explain you what i'm trying to do in order to know if there's a better solution.
I want to remove all the faces of an object that do not appears on camera.
First of all i simulate the camera view with a pyramid aligned to the camera object. I don't know the exact size so i have to guess (there's any way to know the exact size of the camera view for doing a pyramid with those values?)
After that i add a volume select modifier for knowing the faces that lay inside that pyramid in order to remove the others.
The problem i have is that the faces that lay inside of the pyramid i use as mesh object are not selected. If i do it by hand it works fine but it does not happend the same if i use scripting. Someone does know the reason?
Thanks in advance for your help!
The code i'm using is this:
obj = box lengthsegs:10 widthsegs:10 heightsegs:10
camPyr=Pyramid width:120 depth:80 height:165
camPyr.pivot = [camPyr.pos.x, camPyr.pos.y, camPyr.pos.z+camPyr.height]
cam = Freecamera fov:45 targetDistance:160 nearclip:1 farclip:1000 nearrange:0 farrange:1000 mpassEnabled:off mpassRenderPerPass:off transform:(matrix3 [0,-1,0] [0,0,1] [-1,0,0] [-165.639,-2.75248,0])
ResetXForm camPyr
camPyr.transform = cam.transform
addModifier obj (volumeselect level:2 type:1 volume:3 node:camPyr)
addModifier obj (edit_Mesh())
