SexFlip v0.2

Using the default makehuman settings, I’ve created a new model for SexFlip Pro v0.2.

I created three models; one with androgynous features, one with a penis and one with breasts. The extra bits were removed from the latter two meshes, leaving floating private parts, the scale of which can be controlled separately as in SexFlip v0.1.

Trannie simulator v0.2

The boobs and willy can still be scaled to ridiculous proportions, but they don’t float away so much any more. The seams of the breasts are awful, though.

You’ll need Java and Java3D.

Again, Java and Java3D are needed, and program source and models can be found in the jar.

The only bit of programming that had me scratching my head was figuring out how to scale a Shape3D in java from a specific point, rather than scaling the model around point 0,0,0 as is the default behaviour. In blender for example, you can choose to scale around the cursor rather than around 0,0,0. A brief google search didn’t yield any tips on how to do this, and I’m sure the functionality must exist in the API, but it’s eluded me. So instead I did as follows:

  1. Create a vector representing the centre point of the scale transform, let’s call it C.
  2. Multiply this vector by the scale factor, S, resulting in a vector D.
  3. Apply the scale transformation (S) to your shape as normal.
  4. Subtract vector D from C, giving E.
  1. Apply a translation transformation to your shape, using the vector E to specify the translation.

In other words, subtract the distance that the shape gets displaced, from its starting point. Or in Javanese:

  1. Transform3D t = new Transform3D();
  2.  
  3. // Making the shape 10 times bigger
  4. double scale = 10.0;
  5. t.setScale( scale );
  6.  
  7. // Scaling around the point 0, 0.085, -0.41
  8. Vector3f center = new Vector3f( 0.0f, 0.085f, -0.41f );
  9.  
  10. // Duplicate the centre vector and scale it
  11. Vector3f scaledCenter = new Vector3f( center );
  12. scaledCenter.scale( (float) scale );
  13.  
  14. // Subtract one from the other
  15. center.sub( scaledCenter );
  16.  
  17. // Combine the translation and scaling into one transform operation
  18. t.setTranslation( center );
  19.  
  20. // Finally, apply the transform to the shape
  21. willy.setTransform( t );
  22.  

My code’s a little different so that might not work without tweaking. Feel free to share a better way of scaling around a point in Java3D if you know it.

No comments

Post a comment


Name:  
Remember personal info?

Email:
URL:
Comment: Emoticons / Textile

This is not a trick question, but a mechanism for spam prevention.
 

  ( Register your username / Log in )

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Powered by Pivot. RSS Feed & ATOM Feed