Results 1 to 6 of 6
Like Tree1Thanks
  • 1 Post By ILikeSerena

Math Help - Create a 3D voxel image out of an math function

  1. #1
    Newbie
    Joined
    Dec 2012
    From
    germany
    Posts
    3

    Create a 3D voxel image out of an math function

    Hey!

    I have an equation F(a,b) = ( X(a,b), Y(a,b), Z(a,b) ) and i want to create a 3D voxel image out of it ( like this ). Therefore i create a new empty image and run through it. For every voxel i check if i'm inside or outside of the object that the equation F(a,b) describes. There is my problem. How can i convert the equation F(a,b) so that i can check for a point (x,y,z) if i'm inside or outside?

    Thanks for your help.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,881
    Thanks
    697

    Re: Create a 3D voxel image out of an math function

    Hey host.

    Have you considered or heard about the convex hull? It is used in computational geometry for this very reason (also consider other bounding elements).

    Convex Hull Algorithms
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2012
    From
    germany
    Posts
    3

    Re: Create a 3D voxel image out of an math function

    Quote Originally Posted by chiro View Post
    Have you considered or heard about the convex hull?
    Yes, i'm aware of the idea of the convex hull. Sorry for my bad english. I will be trying to explain better what i want to do.

    I create an image of 100 pixel x 100 pixel x 100 pixel. At the beginning every pixel is empty (= 0). Now i run through the image pixel per pixel and check with the equation if i'm outside of the object or inside (here is my problem). If i'm inside i have to set the value to 1. At the end i have an image with an approximation of the object with pixels that have the value 1.

    So my problem is, if i run through the image i have the coordinates x, y and z and i only have an equation F(a,b) = ( X(a,b), Y(a,b), Z(a,b) ) that describes the surface of an object. Is there any possibility to to check if i'm inside or outside of that object?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member ILikeSerena's Avatar
    Joined
    Dec 2011
    Posts
    733
    Thanks
    121

    Re: Create a 3D voxel image out of an math function

    Hi host!

    Suppose instead of running through each pixel, you run through each value of (a,b) with some (small enough) step size (that can be optimized).
    Set each pixel you find to 1.
    Afterward, scan through each line and fill pixels whenever you pass a 1, and stop filling when you pass another 1.
    Thanks from host
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Joined
    Sep 2012
    From
    Australia
    Posts
    3,881
    Thanks
    697

    Re: Create a 3D voxel image out of an math function

    Consider a modified form of the Bresenham line algorithm across a surface:

    Bresenham's line algorithm - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Dec 2012
    From
    germany
    Posts
    3

    Re: Create a 3D voxel image out of an math function

    Thank you guys!

    Quote Originally Posted by ILikeSerena View Post
    Suppose instead of running through each pixel, you run through each value of (a,b) with some (small enough) step size (that can be optimized). Set each pixel you find to 1.
    That works for me .

    Quote Originally Posted by ILikeSerena View Post
    Afterward, scan through each line and fill pixels whenever you pass a 1, and stop filling when you pass another 1.
    The equation describes a concave surface. So i had to scan in -x and x direction and in -y and y direction if i'm inside of the hull.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Create a special function
    Posted in the Advanced Applied Math Forum
    Replies: 0
    Last Post: November 23rd 2010, 09:15 AM
  2. Replies: 4
    Last Post: September 30th 2010, 05:40 AM
  3. I need to create some math problems...
    Posted in the Algebra Forum
    Replies: 3
    Last Post: September 13th 2009, 07:28 AM
  4. create function
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: July 5th 2009, 05:29 PM
  5. create math formula
    Posted in the Math Topics Forum
    Replies: 5
    Last Post: March 24th 2009, 08:13 AM

Search Tags


/mathhelpforum @mathhelpforum