Jump to content



Photo
- - - - -

Howto: using FP 3D models in VP


  • Please log in to reply
81 replies to this topic

#61 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 27 October 2013 - 02:52 PM

Alright, my texture size for the test is 2048x2048... here are a couple screenshots of the model...

As viewed in 3ds max (outer cover doesn't show as translucent, but you should get the idea...)
6d494f1dcdb8db0832dc8d3cd0c0127f_t.jpg

As viewed in VP
711782b593fde19124deb50ceddfba97_t.jpg
In operation, the wheel should rotate counter clockwise with the cover being the front.
The one on the left is the way it appears by default (rotated slightly for effect). The entire model is mirrored over the x axis as well as the texture. On the stickers, the woman should be on the right hand side (harder to see because of the view angle), but she ends up on the left, as well as the wheel being oriented incorrectly. The one on the right has the size for x changed to -1 (negative 1). The wheel is now oriented correctly so that when it spins counter clockwise the ball will move from the right, over the top, and out the left. When I do this though, the texture is messed up.

Here is a zip with all the files I think you might need... I have the table file as seen in the image, the obj file, the image texture, as well as my 3ds .max file with the model and .uvw (just in case)
Attached File  Wheel Model.zip   3.66MB   13 downloads

Edit: If I need to go and adjust it accordingly, I will, but I was just curious if I was doing something wrong or if there might be a possible bug with importing :D

Edit 2: I did some more playing around and had another question...  :love39:  It seems any changes I make when rotating the primitive are only applied relative to the table, but was wondering if there is a way (or might be in the future  :D ) to rotate on an axis relative to the object itself.  For example, when I import my wheel, I can rotate it by adjusting the X axis, and it will spin round and round like it should... but I can only view it from head on. If I try to rotate it on the Z axis to get more of a profile view (as seen in the screenshot above), it throws everything out of whack and then it is more like a wobbly wheel (still rotating on the x axis of the table, not the object). What would be desirable is to have the X, Y, and Z axes be relative to the object, so I could rotate the wheel on the z axis to get a profile view and then animate it on the X or Y axis to get the wheel spinning without mucking everything up.

 

Here is a table to illustrate my point, with 2 wheels, one rotated by 45 degrees on z axis to get a profile view...  Left Flipper key will start the animation, Right Flipper will reset it.

Attached File  Wheel Rotation Test.zip   1.82MB   11 downloads


Edited by koadic, 27 October 2013 - 04:06 PM.


#62 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 27 October 2013 - 04:49 PM

Ok will check it. But your texture size is by far too big. 512x512 should be enough. I haven't looked into your model but I think your object isn't centered around the origin.
The importer takes the coordinates as found in the obj file there is no conversion.
More later...

#63 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 27 October 2013 - 05:04 PM

Ok, some more info for ya...  the 0,0,0 point of the model is the center of the back cover (220 units in height, in VP the z position set to 110 to bring entire model above playfield), and any adjustments use this as a pivot point. Another example of what I am talking about as far as rotation would be to take the table I linked above, change the second wheel to a z rotation of 180 instead of 45. If rotation would be relative to the object instead of the table, you would expect to have the wheels appear to rotate in opposite directions (as one is flipped 180 degrees), even though the x rotation is being adjusted by the same amount for both. The actual result is both wheels appearing as if they are rotating in the same direction regardless of the object orientation.

 

As far as the texture size, I might be able to get away with a 1024x1024, but at 512x512, the decals on the wheel are pretty blurry :)

 

And I want to add that I appreciate your help with this.


Edited by koadic, 27 October 2013 - 05:06 PM.


#64 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 27 October 2013 - 07:33 PM

Ok checked you model. The problem for the mirrored object was: it was huge. I mean really huge ;) I had to scale it down by 0.01 in Blender until it had a size which is much more VP friendly. Now you can leave the scale factor by 100 and not to 1 or even lower :) The next problem was that the origin was not the object center. I attached the changed model.

The rotation in VP is indeed a problem. The rotation/translation code for meshes is the same as for the old primitives. I stumbled on that once I tried to use a primtive for the thing in TAF. The problem with the rotation/translation code is, if I change it it will have an impact on tables using the old standard primitives...

Attached Files


Edited by fuzzel, 27 October 2013 - 07:37 PM.


#65 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 27 October 2013 - 08:11 PM

fuzzel, if the rotation/translation is 'wrong', would it be reasonable to add a checkmark for 'backward compatible orientation'?  That way the table designers can move forward with the 'correct' orientation, and eventually deprecate use of old rotation/translation.

 

It would be best to make that decision before the official release of 9.1.6 with mesh support.

 

It would be great if editing models in blender would have the same orientation as in VP.

 

BTW, separate issue, I notice that, on my rings, if I rotate my ring 90 degrees (about the Z axis), the sphere mapping has one look; and when I rotate it by 270 degrees (about the Z axis), the sphere mapping has a different look (the light and shadows appear reversed).  Shouldn't they look the same?  Is the sphere mapping applied, then rotated?


ultradmd_splash.png


#66 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 27 October 2013 - 10:33 PM

I appreciate you taking the time to look at this...

 

Tried the new obj file, still have the same issue though. While the model is now 1/100 scale, the model and texture are still reversed on the X axis

388b327725aaaf4f933cb730e779a50a_t.jpg

In the image above, the solid blue should be in the back with the translucent part in the front, along with the decals being wrong...

 

After some messing around with the model and mapping coordinates...

da2e3f6218b5c30c61657dbd1bdf715e_t.jpg

This is how it SHOULD appear (how it originally appears in the modeling software), although I have gone through the trouble of altering both the model and map so it appears correctly in VP. This is what I expected it to look like initially even though the model itself is now wrong.

 

I think I recall reading in the Monster Bash thread that they are experiencing flipped textures as well, and I might even go so far as to guess that the models themselves are also mirrored even though they are fairly symetrical so it might not be initially evident. If I had solid covers on both sides of the wheel, I might also assume it was just an issue with the texture being flipped, but with a solid cover and translucent cover I can tell that the entire model is being mirrored on the x axis. I can go forward doing it this way if needed, I just think that there might be as issue with the code where the meshes are being imported incorrectly. 

 

With the rotation issue, there are a few things that I can think of to include a fixed rotation... in the position section, there are already 6 modifier slots, RotX through Z and TraX through Z. You could add 3 more modifiers like ObjRotX/ObjRotY/ObjRotZ (or however you think they should be named) and either include 3 additional slots, or just have the new options be available in the dropdown for the already existing 6 slots so they can be set in the table to use the different modifiers (the selections are saved with the table).



#67 fuzzel

fuzzel

    spaghetti code

  • VP Dev Team
  • PipPipPipPipPip
  • 2,818 posts

  • Flag: Germany

  • Favorite Pinball: yes I have

Posted 28 October 2013 - 07:35 AM

The importer does what it should, The problem is that it depends on the 3D tool you're using and how the coordinate system is initialized. Some tools are using a left handed system others a right handed system. I'm not a 3DSMax expert but it seems that 3DSMax either has a right handed system (X axis is facing to the left) or the exporter converts it. If I load your obj file into blender and assign the texture to it I see the solid blue side in front. Blender rotates every imported obj file around 90 degrees around the X axis, if you import that into VP you have to rotate the X axis around 90 degrees again (so in sum a total of 180 degrees).

If I export a mesh from FP or do my own one I rotate the object around the X axis about 180 degrees before I export it. Then in VP the object orientation will be the same as in Blender before I rotated it. So because of the different 3D tools out there (3DSMax, Maya, Cinema4D, Blender...) I don't want to mess around with the object while importing it, because if it looks right for objects exported by 3DSMax it won't be correct for objects exported by Blender or Maya.

 

The idea of adding 3 new modifiers to the dropdown is a good one. Let's see how this works out ;)



#68 koadic

koadic

    Pinball Fan

  • VIP
  • 1,363 posts
  • Location:Omaha, NE, USA

  • Flag: United States of America

  • Favorite Pinball: Addams Family/Fish Tales/Medieval Madness



Contributor

Posted 28 October 2013 - 12:57 PM

Cool, just got home from work so I will go ahead and compile the latest revision and give those new modifiers a test run...

 

On the subject of the mesh import, I am not really talking about the orientation on the table, but the fact that if an asymmetrical object is imported it will be reversed. For example, say you have a model of a pirate with an eye patch on his left eye and a parrot on his right shoulder when looking at him from the front, after you import it into VP, the pirate will then have an eye patch on his right eye and the parrot will be on the left shoulder...  the entire mesh is reversed on the X axis effecting both the model and the texture. Again, I can work around it by modeling it with that in mind (not a big deal, really :D), but I just wanted to bring the issue up in case there was a possible fix for it.



#69 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 28 October 2013 - 06:20 PM

BTW, thanks for getting the sphere mapping in.  It's still going to be a challenge to get the flat ramp 'wire' textures to match the ring/end piece sphere mapped textures.  But what we have now, is a tremendous improvement. :dblthumb:


ultradmd_splash.png


#70 unclewilly

unclewilly

    sofa king.....

  • VIP
  • 5,173 posts
  • Location:Baltimore, Maryland

  • Flag: United States of America

  • Favorite Pinball: tz, tom, big hurt, who dunnit



Posted 29 October 2013 - 12:29 AM

Hey ultrapeepi, Look at my 3d modeler for monster bash thread.

I've yes fp ramp ends and spheremapped hem. I used the same texture on the wire ramps and it matches almost seamlessly.

I used the fp texture [chrome - white]. And just darkened it a little in Photoshop

Edited by unclewilly, 29 October 2013 - 12:30 AM.

"it will all be ok in the end, if it's not ok, it's not the end"
 
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx

uw2.gif


#71 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 29 October 2013 - 04:34 AM

Thanks unclewilly, I was just looking at that.  It's a pretty amazing job you did blending the two.  I couldn't quite get there.  I'll try again with [chrome - white].


ultradmd_splash.png


#72 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 29 October 2013 - 05:45 AM

Ahh.  [chrome - white] from FP is special.  The texture extends outside the sphere.  So it can double as a flat ramp texture as well.

 

I am able to reproduce your results.


ultradmd_splash.png


#73 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 29 October 2013 - 06:59 AM

Attached File  Metal Ramps 01.png   552.7KB   6 downloadsAttached File  Metal Ramps 02.png   549.07KB   4 downloads

 

This is what I was able to do by editing the [chrome - white] sphere texture, and applying it both to the flat ramp as well as the 3D models.  It's really close to a match.  And it's convenient because the texture is being reused.  If there wasn't a ring, you'd be able to see the difference at the joint.  Actually, you can see it anyway - but it's probably only noticeable if it is pointed out.  The colors match - just not the lighting.

 

My flat ramps, representing the wire rails, have a width of 7.  This perfectly matches the end piece wire gauge.  I added a "drop shadow" ramp with the walls visible.  These are just a flat dark color.  Black didn't look right.  So for the silvery wires, it is charcoal; and for the copper sphere, it's more of a brown.

 

Any suggestions on how to make it better, please let me know.


ultradmd_splash.png


#74 ICPjuggla

ICPjuggla

    Early Retirement

  • VIP
  • 1,193 posts

  • Flag: United States of America

  • Favorite Pinball: Star Wars

Posted 29 October 2013 - 05:57 PM

UltraPeepi I'm really intrigued with the wire work. It looks fantastic! :-) care to set up a tutorial on how you achieved the final result! I wouldn't mind updating some of the tables I've worked on and am in the process of working on. It looks awesome!

cosmicgunfight-sig2.png breakshot-sig-small3.png atlantis-sig-small.png mousinaround-sig6.png hurricane-sig16.png sc-badge1.png lw-sig.png embryon-logo0.png icp-3.png apollo13_badge(1).png whirlwind_badge0.png playboy_badge0.png oxo1.png raven_logo.png rambo_logo4.png


#75 unclewilly

unclewilly

    sofa king.....

  • VIP
  • 5,173 posts
  • Location:Baltimore, Maryland

  • Flag: United States of America

  • Favorite Pinball: tz, tom, big hurt, who dunnit



Posted 29 October 2013 - 06:32 PM

It's all in the texture.
On mb I'm doing 7 width wires with the bottom 5 units below the top.

Imagemode wrap
I use the fp texture chrome white but I darken it a little in Photoshop

The ramp ends look so good because they are fp models imported into vp with the same texture spheremapped to the mesh

The rings are also models

"it will all be ok in the end, if it's not ok, it's not the end"
 
Monster Bash VP10 WIP https://dl.dropboxus... (vpx)WIP15.vpx

uw2.gif


#76 ICPjuggla

ICPjuggla

    Early Retirement

  • VIP
  • 1,193 posts

  • Flag: United States of America

  • Favorite Pinball: Star Wars

Posted 29 October 2013 - 06:43 PM

Thx Scott.

I'm going to have to look into this!

Awesome idea looks killer!! :-)

cosmicgunfight-sig2.png breakshot-sig-small3.png atlantis-sig-small.png mousinaround-sig6.png hurricane-sig16.png sc-badge1.png lw-sig.png embryon-logo0.png icp-3.png apollo13_badge(1).png whirlwind_badge0.png playboy_badge0.png oxo1.png raven_logo.png rambo_logo4.png


#77 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 29 October 2013 - 07:00 PM

I'm trying to get it all worked out myself.  It should be slick; but I'm not quite there.  I did start documenting my steps (started with steps from fuzzel and tweaked).  To get the different metals, I used my favorite feature of Gimp - "colorize".  I took the [chrome - white] sphere texture from FP (read earlier post for why that one works and the others don't).  Then I "colorized" to produce the different metals: gold, copper, etc.

 

unclewilly and I ended up at the same place independently.  The rails are the normal 7 units wide flat ramp.  Below each flat ramp, is another flat ramp with walls (mine are 2 - 3 units high) to provide the underside shadow (I got this technique from other tables).


ultradmd_splash.png


#78 ICPjuggla

ICPjuggla

    Early Retirement

  • VIP
  • 1,193 posts

  • Flag: United States of America

  • Favorite Pinball: Star Wars

Posted 29 October 2013 - 08:59 PM

It might come as a surprise but I've never tried FP... lol I don't have it installed and have actually never even played with it! :-(

I understand the rail part that's how I've been making the rails for the tables I've help create.. :-)

I guess all I would need would be the textures used and the models rings, rail ends etc. and I think I could figure it out from there.. :-)

Are the models available for download anywhere or do they need to be pulled out of FP tables?

cosmicgunfight-sig2.png breakshot-sig-small3.png atlantis-sig-small.png mousinaround-sig6.png hurricane-sig16.png sc-badge1.png lw-sig.png embryon-logo0.png icp-3.png apollo13_badge(1).png whirlwind_badge0.png playboy_badge0.png oxo1.png raven_logo.png rambo_logo4.png


#79 UltraPeepi

UltraPeepi

    Enthusiast

  • Platinum Supporter
  • 216 posts
  • Location:Redmond, WA

  • Flag: United States of America

  • Favorite Pinball: Mary Shelly's Frankenstein

Posted 29 October 2013 - 09:44 PM

Attached File  chrome-copper.png   17.74KB   3 downloads

Attached File  chrome-gold.png   18.74KB   4 downloads

Attached File  chrome-nickle.png   16.36KB   3 downloads

Attached File  chrome-silver.png   11.86KB   3 downloads

Attached File  chrome-steel-blue.png   19.37KB   3 downloads

Attached File  chrome-white.png   22.38KB   3 downloads

 

[chrome-white], the last one, came from FP.  The rest I created using Gimp colorize.  Surprisingly, you can use the image as-is for your wire texture in your flat ramp.  It has an interesting effect that looks pretty good.

 

I can PM you some models to play with if you want.  It's a multistep process to export/transform them into something usable by VP.  You not only need FP, but 3 other apps as well.


Edited by UltraPeepi, 29 October 2013 - 09:45 PM.

ultradmd_splash.png


#80 ICPjuggla

ICPjuggla

    Early Retirement

  • VIP
  • 1,193 posts

  • Flag: United States of America

  • Favorite Pinball: Star Wars

Posted 29 October 2013 - 11:11 PM

Yes that would be great.. We can talk more in a PM

cosmicgunfight-sig2.png breakshot-sig-small3.png atlantis-sig-small.png mousinaround-sig6.png hurricane-sig16.png sc-badge1.png lw-sig.png embryon-logo0.png icp-3.png apollo13_badge(1).png whirlwind_badge0.png playboy_badge0.png oxo1.png raven_logo.png rambo_logo4.png