Author |
Message |
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Mon Jun 20, 2005 9:15 pm Post subject: blender 3d rotation kit |
|
|
|
|
I thought I'd post some stuff I made to help turn 3d models from blender into ship sets. The quality and useability isn't that great but it might be useful to someone.
ssrot-blender.txt
This is a python script that will rotate multiple objects in 9 degree increments and save the renders to disk. If you open it in the blender text editor you can press alt+p to execute it. You'll probably have to edit it slightly to suit your model.
ssm/sprite sheet maker
A modded version of 'font sheet maker' than accepts the rendered frames (from blender or any other source) and assembles them into a shipset. Currently the input/output format is png, but I might change the input to support other formats.
You have to select all the frames at once using shift/ctrl click since I haven't written a fancy dialog to make it more obvious what's happening.
Here's a sample of the final output:
http://toktok.sscentral.com/dump/ship3.png (240k)
I'm still learning this 3d stuff so that's why it doesn't look too good.
Edit: Updated script (scroll down or http://forums.minegoboom.com/download.php?id=1234)
Edit: Video tutorial http://www.youtube.com/watch?v=f6ByhEIwLuo _________________ ss news
sprite sheet maker (java 1.4)
ssm-beta1.zip - 9.83 KB
File downloaded or viewed 216 time(s)
old version
ssrot-blender.txt - 1.04 KB
File downloaded or viewed 205 time(s)
Last edited by Smong on Wed Feb 21, 2007 2:49 pm, edited 2 times in total |
|
Back to top |
|
|
blaine0002 Novice
Joined: May 26 2005 Posts: 50 Offline
|
Posted: Mon Jun 20, 2005 9:30 pm Post subject: |
|
|
|
|
I dont use blender but i have to say,
Sweet ass tank
|
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Thu Jun 23, 2005 6:25 pm Post subject: |
|
|
|
|
Now anyone can make good 3d ships, as blender is free _________________
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Aug 05, 2005 10:42 pm Post subject: |
|
|
|
|
I have decided this is bugged. Take a look at this image:
The barrel doesn't line up with the red line where ss actually fires weapons. Can anyone figure this out?
(As you can see I also spent some time improving the tank since the original post).
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Fri Aug 05, 2005 10:53 pm Post subject: |
|
|
|
|
Smong wrote: | The barrel doesn't line up with the red line where ss actually fires weapons. Can anyone figure this out? |
Its an isometric view. Subspace works from a top-down view.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Fri Aug 05, 2005 11:01 pm Post subject: |
|
|
|
|
It should still be possible to automate the rotation and rendering process from a script regardless of camera angle. There is no way I am doing all 40 frames by hand. What if I re-skinned it or added more detail? That's another 40 painful manual rotations.
BF's CS and DOD shipsets along with wormhole surfers shipsets are all isometric. However extracting information from the zone owners/shipset creators is proving hard.
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sat Aug 06, 2005 12:36 am Post subject: |
|
|
|
|
Use trigonometry. Based upon the angle from top-down view, the line of sight of the barrel changes. Since you want it to be at set 9 degrees each step, you can determine the physical angle you need to move the tank at for your angle of view so it looks like it is stepping 9 degrees. It should come out as a sin wave type stepping system (like rotate 8.5 degrees, then 8.2, 8.0, 8.2, 8.5, 9.0, etc).
Either way, with a tank like that, I'd think it would look cooler if you'd have the turret be the turret.bm2 image, and the tank be ship8.bm2 or something. Then the ship would have its own weak machine gun, but only allow one ship to attach. Make it so whoever can attach starts with a blank or crappy ship, and when they attach, a bot will prize them bombs. Now, that would be pretty cool and very realistic. Bonus if you use ASSS so whenever someone issues an attach request, you actually change their ship to a Shark also, prize them with what they need. Then when they disattach, change them back to a normal ship, or remove their bombs. That way you are only sacrificing one ship to be a special for both a tank and the turret.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sat Aug 06, 2005 10:09 am Post subject: |
|
|
|
|
I'll look into the trig thing, I suspected it might be one of the ways to do it.
I probably won't seperate the turret for this particular tank, but I'll see how it goes.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Sat Aug 06, 2005 10:56 am Post subject: |
|
|
|
|
Ok. I did the math...
Basically, you want the angle defined by tracing out 1/40 the circumference of an ellipse.
The ellipse is defined as
x = cosine(sigma)
y = sine(phi) * sine(sigma)
Sigma is your incrementing of 9 degrees starting for due east moving northward if you drew a compass rose on the camera lens. Phi is the angle between the x-y plane and the ray along which the camera looks. I apologize for the unusual symbols. I started with the normal phi and theta, but theta dropped out pretty quickly.
Anyhow, the real angle to rotate can be found by the arctan of (y/x) compensated for the signs of x and y. You need to make sure you get the sign right, because the codomain of arctan is only pi/2 to -pi/2. and you want from pi to -pi (or 0 to 2pi, as the case may be). _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sat Aug 06, 2005 5:05 pm Post subject: |
|
|
|
|
With the help of Dr Brain I fixed the script to work with isometric views. I also took out an unecesary piece of code that slowed down the rendering process and added support for rolls! Sprite sheet maker can make the rolls image too, just change the number of rows to 40. Although I had to do 200 frames at a time and join the 2 halves together to make the final rolls image because my computer couldn't handle it.
Here's another ship I made, it took 2 and a half hours to make.
Anyone can use this ship and the rolls in their zone.
the updated rotation script
woot.txt - 2.66 KB
File downloaded or viewed 879 time(s)
wbroll.png - 155.93 KB
File downloaded or viewed 191 time(s)
ship1.png - 17.53 KB
File downloaded or viewed 149 time(s)
|
|
Back to top |
|
|
Quan Chi2 Member of "Sexy Teenagers that Code" Group
Age:33 Gender: Joined: Mar 25 2005 Posts: 860 Location: NYC Offline
|
Posted: Wed Aug 24, 2005 8:46 pm Post subject: |
|
|
|
|
lol the tanks from the first post looks like grey boxes with scratches on it lol
|
|
Back to top |
|
|
Proto Guest
Offline
|
Posted: Wed Mar 29, 2006 12:24 am Post subject: |
|
|
|
|
How do I set the camera up properly to follow it
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Mar 29, 2006 8:32 am Post subject: |
|
|
|
|
Just make the model appear to be facing upwards like this:
The camera object is the solid rectangle, and the dotted rectangles give you some idea what will appear in the final image.
For this overlord tank I also added some tilt to make it appear 3D rather than a top down view.
If you put a tilt on it make sure to edit the script too:
If you're new to blender you can select objects (such as the camera) with right click. Then press "n" on the keyboard, a little window will pop up (called "Transform Properties") letting you adjust the position and angle of the currently selected object.
Edit: lol camera.png was actually a bmp, fixed it now.
camera.png - 37.76 KB
File downloaded or viewed 100 time(s)
camera2.png - 6.15 KB
File downloaded or viewed 96 time(s)
tilt.png - 11.37 KB
File downloaded or viewed 91 time(s)
Last edited by Smong on Wed Feb 21, 2007 2:52 pm, edited 2 times in total |
|
Back to top |
|
|
BDwinsAlt Agurus's Posse
Age:33 Gender: Joined: Jun 16 2003 Posts: 1145 Location: Alabama Offline
|
Posted: Thu Mar 30, 2006 5:27 pm Post subject: |
|
|
|
|
Dude that is awesome. Thanks for the post.
|
|
Back to top |
|
|
PRotosex Guest
Offline
|
Posted: Fri Mar 31, 2006 7:42 pm Post subject: |
|
|
|
|
Never mind , all I had to do was center the model
|
|
Back to top |
|
|
Denon Newbie
Gender: Joined: Aug 28 2005 Posts: 9 Offline
|
Posted: Sun Jun 04, 2006 7:58 pm Post subject: |
|
|
|
|
That shipset is just awesome, beats the default ones hands down.
Nice work Smong. _________________ Denon
|
|
Back to top |
|
|
dropoe Guest
Offline
|
Posted: Wed Jul 05, 2006 11:29 am Post subject: problem |
|
|
|
|
when i try to run the script, it gives me python script error and it highlights the following line:
obj = Blender.Object.Get(OBJECTNAME)
I don't know how to fix this
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Thu Jul 06, 2006 8:50 am Post subject: |
|
|
|
|
In object mode select the object so the edge of it is pink. Then go to the mesh buttons (F9) to find out the name of the object. Finally edit the script to use the correct object name.
Infact I just noticed it also has the name of the object in white at the bottom left of the 3D window.
objectname.png - 27.14 KB
File downloaded or viewed 83 time(s)
|
|
Back to top |
|
|
dropoe Guest
Offline
|
Posted: Sun Jul 09, 2006 9:23 pm Post subject: |
|
|
|
|
thx alot
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Feb 21, 2007 2:54 pm Post subject: |
|
|
|
|
I have made a short video explaining how to use the script:
http://www.youtube.com/watch?v=f6ByhEIwLuo
I also corrected one of my replies that had a bmp in it instead of a png
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Wed Feb 21, 2007 3:01 pm Post subject: |
|
|
|
|
Smong wrote: | I have made a short video explaining how to use the script |
Short seems to be the best word I have for it. Your text over the window is hard to read and generally isn't on the screen long enough to read it. If you have the original video still, I'd recommend added some black space to the bottom and putting subtitles there. Pause the video on the text a little longer.
|
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Feb 21, 2007 3:13 pm Post subject: |
|
|
|
|
Well I used windows movie maker.
- I tried the "subtitle" text overlay, but the text looks bad with anything other than white since it adds black fuzz around it, and you can't change the color of the fuzz. The only other type of text overlay that seemed to look good was "basic".
- Pausing the video is hard and fiddly, it involves splitting the video up, taking screenshots and inserting those like slide show frames.
Yes it could be better, but since it's a video I figure people can watch the parts that are too fast several times over, pausing it if necessary. I suppose I should redo it like you said, infact if I add a black bar at the bottom with virtualdub somehow that would change the aspect ratio, and if I'm correct that means youtube will store the video at a higher quality/res. I would like to be able to do that "zoom in" thing at specific places so people can see where I'm actually typing/clicking.
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Wed Feb 21, 2007 4:04 pm Post subject: |
|
|
|
|
Taking 6 or so screen shots and just writing text under them in a webpage (such as the wiki?) would be just as useful as the video.
|
|
Back to top |
|
|
|