POV-Ray : Newsgroups : povray.advanced-users : Automised visualization of a 'hasn't to be square' room Server Time
29 Jul 2024 18:27:04 EDT (-0400)
  Automised visualization of a 'hasn't to be square' room (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Remco Poelstra
Subject: Automised visualization of a 'hasn't to be square' room
Date: 24 Dec 2000 08:51:35
Message: <3A4750EE.7050301@home.nl>
Hi,

I'm writing a little piece of software, which does some calculations 
about reflections in a room.
The user specifies 6 planes, which are the walls, a 'listener' and a 
'soundsource'.
I want to visualize the room and the first reflections with povray, but 
I've a lot of problems doing so:
The 2 major problems are:
1. I used intersection{ to make the box out of the planes, but since I 
don't know where the planes are, I can't know when I have to do inverse, 
and when not, assuming that every wall will be at another side of 0,0,0 
, but even that isn't for sure. How can I easyly create a box when I 
have only 6 planes?
2. When I've the box created, how can I look "inside", to see what's 
going an? TonyB suggested to make the box out of triangles and take a 
few away, making a hole, but since I have only the 6 planes, I don't 
know how the convert them to triangles and take the right ones away.

I hope someone can help me with this problem,

Remco Poelstra


Post a reply to this message

From: Chris Huff
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 24 Dec 2000 09:44:49
Message: <chrishuff-367F16.09460324122000@news.povray.org>
In article <3A4### [at] homenl>, Remco Poelstra 
<rjp### [at] homenl> wrote:

> 1. I used intersection{ to make the box out of the planes, but since I 
> don't know where the planes are, I can't know when I have to do inverse, 
> and when not, assuming that every wall will be at another side of 0,0,0 
> , but even that isn't for sure.

If you don't know where the walls are, you have a problem...


> How can I easyly create a box when I have only 6 planes?

6 planes are all you need...
intersection {
    plane {y, 1}
    plane {-y, 1}
    plane {x, 1}
    plane {-x, 1}
    plane {z, 1}
    plane {-z, 1}
}
This will give you a box with 90 degree angles, you can adjust the 
planes to do something different.


> 2. When I've the box created, how can I look "inside", to see what's 
> going an? TonyB suggested to make the box out of triangles and take a 
> few away, making a hole, but since I have only the 6 planes, I don't 
> know how the convert them to triangles and take the right ones away.

Make a wall transparent, or put the camera inside the "room"...if the 
"listener" wall shows the sound waves graphically, you can make it show 
them on both sides...a more precise description of what you are 
attempting would help.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Remco Poelstra
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 24 Dec 2000 11:18:58
Message: <3A47737A.7050500@home.nl>
Chris Huff wrote:

> a more precise description of what you are 
> attempting would help.

Ok, I'll try to explain it as clear as possible.
I want to calculate first reflections reverb of a room, outputting a 
wave-file and an image of the situation.
I like to do it in the following way:
I let the user describe the room by giving the equation of 6 planes. He 
also gives the position of the soundsource, imagine it being a speaker 
and the position of a listener, imagine it being you.
I calculate the reflections points, ie, where the sound bounces off the 
wall. Finally I calculate the wave-file.
What I want to visualize is the situation defined by the user, whereby I 
use spheres for the source and the listener, cylinders for the path the 
sound travels from source to wall to listener.
I made a small example of this, with only one soundpath.
http://www.beryllium.net/~remco/room.jpg   4.2kb
This is a very ideal situation.
My problem is now, that the planes can be everyware in any position, 
depending on how the user defined them.
My questions stays the same: How can I let my software output a good 
room( when all I have is 6 planes and a bunch of points), where I can 
look thru, because just taking away one plane as I did in the example is 
almost impossible.

Hope this explanation is a bit clearer,

Remco Poelstra


Post a reply to this message

From: Chris Huff
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 24 Dec 2000 14:09:15
Message: <chrishuff-7CAEBA.14102924122000@news.povray.org>
In article <3A4### [at] homenl>, Remco Poelstra 
<rjp### [at] homenl> wrote:

> My problem is now, that the planes can be everyware in any position, 
> depending on how the user defined them.
> My questions stays the same: How can I let my software output a good 
> room( when all I have is 6 planes and a bunch of points), where I can 
> look thru, because just taking away one plane as I did in the example is 
> almost impossible.

Ok, I understand what you are doing, but I still don't understand the 
problem you are having...why not just put the camera in the room, or 
make one or more walls transparent? Or are you having problems making 
the room itself? Is your problem with the primitives you are using, like 
CSG or a triangle mesh?

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Remco Poelstra
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 25 Dec 2000 07:18:14
Message: <3A488C8F.3010607@home.nl>
Chris Huff wrote:

> 
> Ok, I understand what you are doing, but I still don't understand the 
> problem you are having...why not just put the camera in the room,

Thanks, you give a a good idea. I thought I couldn't place the camera in 
the room, because I couldn't see all reflectionpoints then, but I can 
make a 360 degree image.
A new problem arises with that, when I was experimenting a bit with 360 
degree cameras, it seems that only fisheye gives me 360. 
Ultra_wide_angle gives only 180,
althought I set angle to 360.

> or 
> make one or more walls transparent? Or are you having problems making 
> the room itself? Is your problem with the primitives you are using, like 
> CSG or a triangle mesh?

The biggest problem is now the CSG of the planes. I don't know how to 
determine when to use invert and when not. Just checking whether D (in 
<A,B,C>,D) is negative doesn't work, like it would do for a perfect box, 
with 0,0,0 in it's center.
Perhaps I should use a completly different method  to create the box, 
but I don't know how, because just giving to points like in box{ can't 
give me the possibillity to place walls rotated.
Any ideas?

Remco Poelstra


Post a reply to this message

From: Chris Huff
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 25 Dec 2000 11:59:11
Message: <chrishuff-FC7DFE.12002625122000@news.povray.org>
In article <3A4### [at] homenl>, Remco Poelstra 
<rjp### [at] homenl> wrote:


> The biggest problem is now the CSG of the planes. I don't know how to 
> determine when to use invert and when not. Just checking whether D (in 
> <A,B,C>,D) is negative doesn't work, like it would do for a perfect box, 
> with 0,0,0 in it's center.

You shouldn't need to use "inverse". Just make sure that a point in the 
room is "inside" all of the planes, and intersect them all together.
What is the data you have to work with? Axis-aligned planes and 
transformations? Plane normal and distance? Vertices?
You could start with something like this as a base:

#declare CeilingTrans = transform {...}
#declare FloorTrans = transform {...}
#declare LeftWallTrans = transform {...}
#declare RightWallTrans = transform {...}
#declare FarWallTrans = transform {...}
#declare NearWallTrans = transform {...}

intersection {
    plane {y, 0 transform CeilingTrans translate y}
    plane {-y, 0 transform FloorTrans translate -y}
    plane {x, 0 transform LeftWallTrans translate x}
    plane {-x, 0 transform RightWallTrans translate -x}
    plane {z, 0 transform FarWallTrans translate z}
    plane {-z, 0 transform NearWallTrans translate -z}
}
This should give you an axis-aligned cube where you can adjust each wall 
individually.


> Perhaps I should use a completly different method  to create the box, 
> but I don't know how, because just giving to points like in box{ can't 
> give me the possibillity to place walls rotated.

Well, you could do rhomboid or sheared rooms with a box, but you 
couldn't do trapezoidal shapes. An intersection of planes should work 
fine.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Pete
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 25 Dec 2000 20:45:19
Message: <533.394T1801T12314566PeterC@nym.alias.net>
Call me dense

(ok, you're dense - ed)

but why not use a box for the room object?  If placing the
camera inside the box, add the inverse keyword to the box.
It will render faster than six planes.

consider this macro, which is passed the offsets of the walls
and a texture:

#macro do_room(left_offset, right_offset, floor_offset, ceiling_offset,
near_offset, far_offset, room_texture)
  box {
    <left_offset, floor_offset, near_offset>,
    <right_offset, ceiling_offset, far_offset>
    texture { room_texture }
  }
#end


Pete


Post a reply to this message

From: Remco Poelstra
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 26 Dec 2000 08:36:32
Message: <3A49F06B.3040003@home.nl>
Chris Huff wrote:

> You shouldn't need to use "inverse". Just make sure that a point in the 
> room is "inside" all of the planes, and intersect them all together.
> What is the data you have to work with? Axis-aligned planes and 
> transformations? Plane normal and distance? Vertices?
> You could start with something like this as a base:
> 
> #declare CeilingTrans = transform {...}
> #declare FloorTrans = transform {...}
> #declare LeftWallTrans = transform {...}
> #declare RightWallTrans = transform {...}
> #declare FarWallTrans = transform {...}
> #declare NearWallTrans = transform {...}
> 
> intersection {
>     plane {y, 0 transform CeilingTrans translate y}
>     plane {-y, 0 transform FloorTrans translate -y}
>     plane {x, 0 transform LeftWallTrans translate x}
>     plane {-x, 0 transform RightWallTrans translate -x}
>     plane {z, 0 transform FarWallTrans translate z}
>     plane {-z, 0 transform NearWallTrans translate -z}
> }
> This should give you an axis-aligned cube where you can adjust each wall 
> individually.
> 

Great! Looks like I'm going to use something based on this one.

Thanks for the help,

Remco Poelstra


Post a reply to this message

From: Remco Poelstra
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 26 Dec 2000 08:36:57
Message: <3A49F084.1020604@home.nl>
Pete wrote:

> Call me dense
> 
> (ok, you're dense - ed)
> 
> but why not use a box for the room object?  If placing the
> camera inside the box, add the inverse keyword to the box.
> It will render faster than six planes.
> 
> consider this macro, which is passed the offsets of the walls
> and a texture:
> 
> #macro do_room(left_offset, right_offset, floor_offset, ceiling_offset,
> near_offset, far_offset, room_texture)
>   box {
>     <left_offset, floor_offset, near_offset>,
>     <right_offset, ceiling_offset, far_offset>
>     texture { room_texture }
>   }
> #end
> 

I have considered to just use a normal povray box, but I can't place 
walls rotated in that case.

Thanks for the idea anyway,

Remco Poelstra


Post a reply to this message

From: Chris Huff
Subject: Re: Automised visualization of a 'hasn't to be square' room
Date: 26 Dec 2000 09:44:32
Message: <chrishuff-01FF3B.09455026122000@news.povray.org>
In article <533### [at] nymaliasnet>, Pete 
<Pet### [at] nymaliasnet> wrote:

> but why not use a box for the room object?  If placing the
> camera inside the box, add the inverse keyword to the box.
> It will render faster than six planes.

If you use a box, even with the matrix keyword, you are limited to rooms 
with opposite walls being parallel.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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