The templates on this blog are viewed best in Internet Explorer 7.
Choose a style!
Halos
Rounded Rectangles
Soccer Field
Chrome

None

BlenderBoy's Blender Blog

Aug. 5, 2008

Faking Object Shadows -- Great Camera Setup

Posted in Blender 3D
I received a comment asking how I did the shadows and camera setup in my Car Game.


Shadows: The shadows are are not actual shadows (you have to fake the shape) but are very easy to make.

 1. In the mesh that you want to have the shadow for, make a plane, subdivide it (if you need to), and make it the right shape for your object.

 2. Then, in the 'Editing' buttons (F9) and in the 'Texture Face' panel, set the faces to 'shadow'. Now they will drop strait down the global Z axis and set on the next face that they hit when you start the game engine.

 3. From what I can remember, you need to make sure the face is even, in the 'z' direction, with the object center. To get the right effect, you should also add a semi-transparent material to the shadow faces.



Camera Setup: This is a little more complicated, but all it is, is a bunch of empties and a small script.

Here is a '.blend' file with just the camera setup: Camera Setup.blend. (right click, select 'Save target/link as')

For illustration purposes:


  Empty #1: The Camera!

  Empty #2: The parent of the camera. The script sets the location of this empty to the location of Empty #3.

  Empty #3: This empty is independent. It always tracks Empty #4, and moves toward it at a certain speed. The speed is defined in the script using a certain formula which makes it faster when it is farther away and slower when it is closer.

  Empty #4: This is the main camera position. It sets it's location to the location of one of Empty #6's ray's collision points or the location of Empty #5 if there is no collision. (was that understandable?)

  Empty #5: The location of Empty #4 when there is no collision. It has a location ipo so that it will match the distances of the collision rays from Empty #6 when you change the camera distance during the game by pushing 'c'.

  Empty #6: Parent this to the object you want to follow. This also sends the rays that determine camera collisions.


On the slight chance that you were able to understand that (I'm not a very clear writer most of the time), you now have the basic functions of the setup.
Post A Comment! Send to a Friend!

Comments

Aug. 8, 2008 - some more questions

Posted by Andrew
Thank you very much! I think I will be able to figure out the camera mavement from that! I don't know much about python, but if I see the script, I can usually change it to do what I want.

For the shadow though, I am having some trouble, every time I make another face, then in the texface tab, in the edit buttons, I deselect collision, and select shadow. Then when I run the game, the car just flies forward, like it is detecting a collision, and trying to escape it. I am putting the face in the vehicle mesh, is this correct? I amd running blender 2.46 on windows XP. Also, I have another question, I have a character that doesn't get shaded for some reason. When I set a face of the character to use light, it works, but it only does it to the Active face, and not the selected faces. Is there anyway to set all the selected faces at once? Sorry to bug you again...

-Andrew
Permanent Link

Aug. 9, 2008 - @ Andrew

Posted by BlenderBoy
Your second question first: ... Is there anyway to set all the selected faces at once?

Yes, there is a way to set the faces to receive light all at the same time. There used to be a 'specials' menu for faces where you could set all the selected faces to have collisions, receive light, be invisible, etc..., but in 2.46, as you most likely know, they took out the UV Face Select mode. The menu may still be there somewhere, I just haven't been able to find it yet. Until I do find it, there is another way to do it without selecting and changing each individual face.

Select all the faces that you want to change (make sure one of them is the active face), and change whatever you need to change (in this case, to receive light). Then, in the 3D view, press 'Ctrl-C' ('Copy Face Selected' menu) and click 'Active Mode'. This copies the mode from the active face to the other selected faces.

Make sure to look at the rest of the 'Copy Face Selected' menu because there are many other useful actions.


As far as the shadow goes, I'm not sure why it would do that. If the shadow is in the same mesh it shouldn't cause a problem with it colliding with it's self even if it was set to have collision. Is the car fine before you add the face? If not, make sure there is nothing parented to the object that has collision and is touching it, and that it is not starting in contact with anything.

If nothing works, you can email me the '.blend' file ( StephenF93 @ gmail.com ) and I will see if I can find the problem.


Also, if you have any more questions, feel free to ask me.
Permanent Link

Aug. 16, 2008 - Cool!

Posted by Matt
Wow, that camera setup looks too complicated for me... If I ever decide to make a game I definitely refer to you.

I read on some blog that Pixar, in their latest movie, changed the camera so it was more realistic. Basically, they realized that current 3d cameras are unrealistic because on real cameras the lens is off-set from the pivot point. So in the movie Wall-E, they off-set the lens on the 3d camera just like a real camera.
Reading on the Blender artists forum, someone suggested just parenting the camera to an empty to off-set the lens. Anyway, I just thought that was interesting.

I like your way of doing fake shadows. I'll have to remember that if I ever need it.

Have a great day!
Matt
_________
www.mountuponwingsofeagles.blogspot.com
Permanent Link

Sep. 4, 2008 - Hi!

Posted by TemplateMachine
My name Mary! I just wanted to tell you that I am doing a special template of the week contest, where you get a chance to compete for template of the month, and then a chance compete for Template of the Year! If you want to visit my template blog, and enter a template, just make it, and keep it on your template blog, or somewhere else where people can go to see it. Just let me know if you are going to compete, and let me know where to find it.
Thanks!
Permanent Link

Oct. 15, 2008 - Hey.

Posted by Kekoa
Hey blenderboy. Do you remember me? I'm the kid who started using blender a while back. I asked you a few questions. One was: Is there any tutorials for Blender.

You told me about some tutorial links in a comment. I can't find that comment again. :-( Do you think you could send me another link in a comment?

I'm asking you again because I got a new computer. My old one didn't let me see the tutorials so I ditched the idea of useing blender, but with my new computer I think I might be able to check out the tutorials. So that would be great if you could send me the links.

I have looked around for some tutorials but there was really nothing that worked out. Or it was just some guy showing of what he could do.
Please respond.

Kekoa.
Permanent Link

Oct. 28, 2008 - Untitled Comment

Posted by BobaFett
Yeah I like Blender... probably told you before...
Wotcher
Nathan
Permanent Link

Oct. 28, 2008 - Untitled Comment

Posted by BobaFett
Yeah I like Blender... probably told you before...
Wotcher
Nathan
P.S. you are tagged if you want to do it just go to my blog and see the instructions...
Permanent Link

Nov. 11, 2008 - Untitled Comment

Posted by BobaFett
would you be able to tell me the basics of making a game on Blender? coz I really wanna know... downloaded the car game and it's like a professional game... How long did it take you to make it by the way.
Wotcher
Nathan
Permanent Link

Dec. 5, 2008 - Wow

Posted by 00StormSpotter
That is fascinating!
I'll have to download blender some time.
I am on dial-up so how big is the program?

Andy
The 16 year old storm spotter
Permanent Link

Dec. 7, 2008 - Untitled Comment

Posted by BobaFett
Okay thanks, that game took you THAT long? it's an AWESOME game, what ads to the coolness of it is that you did it on BLENDER and I HAVE blender so YEAH.
Wotcher
Nathan
Permanent Link

Apr. 7, 2009 - Untitled Comment

Posted by burnoutkenobi23
Hello there my name is Gabriel and I wanted to invite you to my Blog.
Dude you have got some sweet stuff going on here with you CGI program. Are you going to work for ILM someday?

Talk to you later.
Permanent Link

May. 29, 2009 - Congratulations!

Posted by Joyful24
YAY! Congratulations! You got it right! =)
It was 10990!

Permanent Link

Aug. 15, 2009 - Untitled Comment

Posted by Joyful24

Huh...wait...I'm deleting my posts? I didn't know that! What posts did I delete. I don't see any missing?
What times are your practices. And are they all at Engel Field? Just wondering.
...Wellll....W needs the "tips"...hehe...
Permanent Link

Aug. 19, 2009 - Soccer

Posted by Joyful24
Hey,

Lol, did it get rained out because I was there for my skills night and W had practice from 5:30 to 7:30. I had to leave because it was raining and W said she didn't see you there. I have skills night tonight again. I have soccer every night of the week except Friday. Lol, well, g2g. Bye!
Permanent Link

Aug. 19, 2009 - Ok

Posted by Joyful24
Hey,
Oh! Ok...I was thinking that was weird for practices to be two days in a row. Lol!
Bye!
Permanent Link

Aug. 20, 2009 - Untitled Comment

Posted by greenpeppermint
Hey Stephen,

I heard your team won your game! That's good!! Didn't the other team you played against get three red cards? Coach Shawn told us about it. :) lol

GrEEnPePPeRmInT
Permanent Link

Aug. 21, 2009 - Untitled Comment

Posted by greenpeppermint
Hey Stephen,

I'm sure coaches love it when refs say that to them. lol :)

The clinic is a two day thing. I think it's from 9:00 to 12:00 on Saturday morning and then from 12:00 to around 5:00 on Sunday. My first game is at 8:30 on Saturday so I'm going to be very late to the clinic. :P When you did your reffing clinic did they give you a test at the end??

Wow, I can't beleive they got three red cards. It seems like refs never give cards! I think I've only been in three games when a ref gave a card out. :) When do you have your next game, this weekend?

GrEEnPePPeRmInT

Edited by greenpeppermint on Aug. 21, 2009 at 12:24 PM
Permanent Link

Aug. 25, 2009 - Untitled Comment

Posted by greenpeppermint
The u18 game went well...we won 6-0...or should I say they won 6-0. :) lol They scored a lot of goals right away.

I heard you won your game on Sunday! Who did you play?

Do you go to the ref meeting at the UAB humanity building every Sunday night? They said that if you want the "first pick" of games to ref then you have to go to that meeting.

When is your next game?? My next game is the tournament this weekend. It's at the state to the right of our state...I don't want to say the name on here. lol

GrEEnPePPeRmInT

Permanent Link

Sep. 1, 2009 - Untitled Comment

Posted by greenpeppermint
That is funny that you were playing your coach's team. lol :)

I had a tournament in Georgia last weekend. We didn't do so well. We lost two games and tied one. :-/

We haven't gone to the ref meeting yet either, we are planning on going though. I haven't gotten any games yet, probly cuz we haven't gone to the meeting.

GrEEnPePPeRmInT
Permanent Link

Sep. 3, 2009 - Untitled Comment

Posted by greenpeppermint
Okay, I'll let ya know what they do at the meeting when we go. I think we might go this Sunday, idk though. :)

GrEEnPePPeRmInT
Permanent Link

Sep. 11, 2009 - Untitled Comment

Posted by greenpeppermint
Yeah, my back feels a lot better. :) I don't think I'm going to be sliding on anymore boards with my cleats anytime soon though. lol

I found out that I do have a soccer game this weekend! It's about two hours away, I don't think we have ever played them before.

GrEEnPePPeRmInT

Permanent Link

Sep. 15, 2009 - Hey!

Posted by tali12
why don't you post more cool stuff? i would love to see more
Permanent Link

About Me

My name is Stephen. I am a Christian, homeschooled sixteen-year-old. The goal of this blog is to display some of the graphics I have created via Blender.

Blender is an open source 3D graphics creation program. It lets you create high quality 3D graphics and movies, and replay real-time, interactive 3D content. It is extremely fun!

Links

Home
View my profile
Archives
Email Me
My Blog's RSS
Tags
Blender Web Site
Blender Tutorials
BlenderNation.com


(yes, it's free!)

Friends

Because my friends list was getting too long for easy navigation down my side bar, I have changed it so it will not be there by default. You can turn it on and then off again by pressing this button.
BlogBoy
AnAmericanGirl
LibertyandJustice
Disneylandguy
chimpzrool
ILoveBaseball
TMoore
MBF
treehouseisland
Jonathan
msquid
IceJet
girlonfire
rejoiceinhope
purpleprincess
NOSboy11
antelopehead
MasterWindu
Politicalguy
JesusLovesU
BlenderBoyTestingBlog
Mater
pcboy
quadguys
Patches
poprocksandcoke42
mbullard
tylerscrashsite
teenforchrist
crazy4jesus
dtalkers
FABLEBOY101
Yankees213
Catcher818

Joyful24
bluidprinces
wings
Alainia
Karrinna16
greenpeppermint

Other

Entry 3 of 50
Last Page | Next Page








These are all the recent main pictures on this blog.
Click the button below, then click a picture to see it full size.
All graphics and templates Copyright © 2009 BlenderBoy (author) - All Rights Reserved