Jump to content

workflow for modeling this tiny planet


rickvdvulkaan

Recommended Posts

Was looking at this, under the heading "render" (scroll down) ; https://www.sidefx.com/products/houdini/houdini-indie/ 

I was just wondering, can you model on a plane/unfolded sphere first, and then "spherize" it? Or would you just model everything onto a sphere directly? what's the best approach here? Is there a neat trick?

 

Edited by rickvdvulkaan
Link to comment
Share on other sites

for roads dokaitutorials..
heightfield tutos you have on Sidefx
details Google ..
wrap with wrangle code :wub:
 

@P= relpointbbox(0,@P);
@P.xyz = @P.zxy;
@P *= {1,1,1};
vector dir = {-1,-1,0};
@P = sample_direction_cone(dir,3.14,vector2(@P));
@P += normalize(@P)*@height *0.0014;
@P *= 400;
@P +={1000,0,0};

or this cvex
 

//float x – X screen coordinate in the range -1 to 1
//
//float y – Y screen coordinate in the range -1 to 1
//
//float Time – Sample time
//
//float dofx – X depth of field sample value
//
//float dofy – Y depth of field sample value
//
//float aspect – Image aspect ratio (x/y)
//
//export vector P – Ray origin in camera space
//
//export vector I – Ray direction in camera space
//
//export int valid – Whether the sample is valid for measuring

#pragma hint    x       hidden
#pragma hint    y       hidden
#pragma hint    Time    hidden
#pragma hint    dofx    hidden
#pragma hint    dofy    hidden
#pragma hint    aspect  hidden
#pragma hint    P       hidden
#pragma hint    I       hidden

#pragma hint    side    oplist
#pragma choice  side    0 "right"
#pragma choice  side    1 "left"

#pragma label   offest  "Pupil Distance"

#include "math.h"

cvex
paronamaLens(
            // Inputs
            float x = 0;
            float y = 0;
            float Time = 0;
            float dofx = 0;
            float dofy = 0;
            float aspect = 1;
            float offest = 1;
            int side = 0;
      
            // Outputs
            export vector P = 0;
            export vector I = 0;
            )
{
   float   halfPI = 0.5 * PI;
   float   xa = -PI * x;
   float   ya = halfPI * y;
   float   sx = sin(xa);
   float   cx = cos(xa);
   float   sy = sin(ya);
   float   cy = cos(ya);

   //correspondent position for eyes
   float px, pz, rotation;
   rotation = lerp(-halfPI, halfPI, side);

   px = cos(xa + rotation) * cos(ya);
   pz = sin(xa + rotation) * cos(ya);

   P = 0.5 * offest * set(px, 0 , pz);
   I = set(cx*cy, sy, sx*cy);
}

 

Fvb.gif

Edited by Librarian
  • Like 1
Link to comment
Share on other sites

Besides the code quality, simply wrapping a square grid onto a sphere would result in heavy distortions. Happens less with spherified boxes:

planet_unwrap.jpg.99c774b4e79bf5724a201c4392981cb0.jpg

Depending on the project, I would probably do the majority of work right on the sphere where every patch is connected, using its normals, surface distances and such.

planet.hiplc

  • Like 1
Link to comment
Share on other sites

 

You might probably need to to use 2d voxel volume heighfield and so work on a plane so you might not always be able to work directly in the 3d sphere itself.  (Projecting the heightfield to a sphere will only work for limited angle before the distortion start to become too important)

You could use the patch node to work on the seam... I did that before.

One other solution will be to work with polar UV no cubic and tweak with a mask to compensate for pole distortion. You need to treat the top and botton on your UV map separately. for these, you need to distort the noise/texture input with polar to cartesian interpolation.

Then you comp the 3 parts of the 2d data together and you should get no seam.  See what i mean? :)

 

________________________________________________________________

Vincent Thomas   (VFX and Art since 1998)
Senior Env and Lighting  artist & Houdini generalist & Creative Concepts

 http://fr.linkedin.com/in/vincentthomas

Link to comment
Share on other sites

very interesting insights!

To be clear, i was mostly wondering about the modeling "strategy", not so much these specific models that you see in the picture. For example, i can imagine that modeling some kind of simplistic city would be more comfortable doing it on a plane first, because it could make things like instancing buildings and creating roads easier, and then wrap it around a part of the globe. 

@librarian, did you come up with that code yourself? jeez :blush:  

I know the basics of the attribute wrangle, but how do i "apply" this cvex code?

Edited by rickvdvulkaan
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...