PDA

View Full Version : 3D renderers: need your help



nephritiri
January 24th, 2008, 04:12 AM
hey.. for those who are dealing with volume graphics... can you help me out here?

im currently rendering regular-shaped objects like boxes...
iv had the space dimension x*y*z and the resolution/voxel density of N voxels/cubic centimeter...

now... i counted the voxels occupied in the space by the rendered object... T voxels...

now... i want to know its equivalent measurement in cubic centimeters in the REAL world... how should i do that? am i missing an important data here? please help... im new to volume graphics...

Methuselah
January 24th, 2008, 05:55 AM
If the voxel density is N voxels/ cubic cm and you counted Y voxels in a given space isn't the volume occupied (N times Y) cubic centimeters?

Anyway, I'm not really dealing with volume graphics so maybe I'm misunderstanding you.

jasay
January 24th, 2008, 07:14 AM
I don't know anything about 3D rendering, but if you have N voxels/cm^3 and T voxels, I would think you want (1/N)*T or T/N.

Math works for units as well as numbers. In this case we want cm^3. Testing my guess
T/N -> voxels/(voxels/cm^3) = cm^3*(voxel/voxel) = cm^3*1 = cm^3 yields the right units. You might be surprised how often you can figure out how to calculate something based only on units.

nephritiri
January 24th, 2008, 01:44 PM
thanks... the very simplicity of these math calculations makes me confused. i think that im getting there to solving it, it's just that im being confused by the results that i get...

ahm... lemme giv an example.

i hav a space of 267x200x267 voxels...
now, let's say that the rndered object occupies 3,146,401 voxels...
i set a voxel density of ... 28.346 voxels/cubic cm

? cubic cm = 3,146,401voxels/(28.346voxels/cm^3)
that yields 110,999.8236cm^3..

but precomputing the real-world object has dimensions of only 21cmx12cmx31cm = 7,812cm^3...

so, i know that i was wrong in setting the voxel density.
having precomputed the real-volume, i should be able to get the voxel density...
1cm^3 = 3,146,401 voxels/(7,812voxels/cm^3)

that yield 402.765105 voxels/cm^3

now, my problem is... im computing volumes of different sample objects...
how can i set the correct voxel density without precomputing the real-world volumes?

honestly, i feel stupid... this should be easy... i just don't get it. need you to enlighten me.
thanks.