Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
blender 3d rotation kit

 
Post new topic   Reply to topic Printable version
 View previous topic  CSLP version... something. Post :: Post New Version of skinedit  View next topic  
Author Message
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Jun 20, 2005 9:15 pm    Post subject: blender 3d rotation kit Reply to topic Reply with quote

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 154 time(s)

old version

ssrot-blender.txt - 1.04 KB
File downloaded or viewed 113 time(s)


Last edited by Smong on Wed Feb 21, 2007 2:49 pm, edited 2 times in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
blaine0002
Novice


Joined: May 26 2005
Posts: 50
Offline

PostPosted: Mon Jun 20, 2005 9:30 pm    Post subject: Reply to topic Reply with quote

I dont use blender but i have to say,

Sweet ass tank icon_lol.gif
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:29
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Thu Jun 23, 2005 6:25 pm    Post subject: Reply to topic Reply with quote

Now anyone can make good 3d ships, as blender is free biggrin.gif
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Aug 05, 2005 10:42 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:34
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3603
Location: Las Vegas
Offline

PostPosted: Fri Aug 05, 2005 10:53 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Fri Aug 05, 2005 11:01 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:34
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3603
Location: Las Vegas
Offline

PostPosted: Sat Aug 06, 2005 12:36 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Aug 06, 2005 10:09 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Dr Brain
Flip-flopping like a wind surfer


Age:31
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Sat Aug 06, 2005 10:56 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sat Aug 06, 2005 5:05 pm    Post subject: Reply to topic Reply with quote

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 797 time(s)

wbroll.png - 155.93 KB
File downloaded or viewed 128 time(s)

ship1.png - 17.53 KB
File downloaded or viewed 88 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Quan Chi2
Member of "Sexy Teenagers that Code" Group
Member of


Age:27
Gender:Gender:Male
Joined: Mar 25 2005
Posts: 860
Location: NYC
Offline

PostPosted: Wed Aug 24, 2005 8:46 pm    Post subject: Reply to topic Reply with quote

lol the tanks from the first post looks like grey boxes with scratches on it lol
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Proto
Guest


Offline

PostPosted: Wed Mar 29, 2006 12:24 am    Post subject: Reply to topic Reply with quote

How do I set the camera up properly to follow it
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Mar 29, 2006 8:32 am    Post subject: Reply to topic Reply with quote

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 43 time(s)

camera2.png - 6.15 KB
File downloaded or viewed 41 time(s)

tilt.png - 11.37 KB
File downloaded or viewed 38 time(s)


Last edited by Smong on Wed Feb 21, 2007 2:52 pm, edited 2 times in total
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
BDwinsAlt
Agurus's Posse


Age:27
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Thu Mar 30, 2006 5:27 pm    Post subject: Reply to topic Reply with quote

Dude that is awesome. Thanks for the post.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
PRotosex
Guest


Offline

PostPosted: Fri Mar 31, 2006 7:42 pm    Post subject: Reply to topic Reply with quote

Never mind , all I had to do was center the model icon_smile.gif
Back to top
Denon
Newbie


Gender:Gender:Male
Joined: Aug 28 2005
Posts: 9
Offline

PostPosted: Sun Jun 04, 2006 7:58 pm    Post subject: Reply to topic Reply with quote

That shipset is just awesome, beats the default ones hands down.
Nice work Smong.
_________________
Denon
Back to top
View users profile Send private message Add User to Ignore List
dropoe
Guest


Offline

PostPosted: Wed Jul 05, 2006 11:29 am    Post subject: problem Reply to topic Reply with quote

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

PostPosted: Thu Jul 06, 2006 8:50 am    Post subject: Reply to topic Reply with quote

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 29 time(s)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
dropoe
Guest


Offline

PostPosted: Sun Jul 09, 2006 9:23 pm    Post subject: Reply to topic Reply with quote

thx alot
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Feb 21, 2007 2:54 pm    Post subject: Reply to topic Reply with quote

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 icon_eek.gif
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:34
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3603
Location: Las Vegas
Offline

PostPosted: Wed Feb 21, 2007 3:01 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Feb 21, 2007 3:13 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:34
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3603
Location: Las Vegas
Offline

PostPosted: Wed Feb 21, 2007 4:04 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Misc User Apps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 28 page(s) served in previous 5 minutes.

phpBB Created this page in 0.153972 seconds : 50 queries executed (50.2%): GZIP compression disabled