camera directed mouse

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

camera directed mouse

Postby mazerrackham » Tue Jul 01, 2008 4:18 pm

I'm trying to make a camera controlled by the mouse and the tutorial on Blender N00b to pro didn't work.

can any one help?

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Tue Jul 08, 2008 4:24 pm

Hello,

I am trying to do the same by using Python-script making to alter the position and the orientation of the camera.

But I am a newby to both Blender and Python, so I am working verry slow but learning by doing ....

Somewhere I read that you could make an object, make it the parent of your camera en let the camera follow the object while you move the object. The object should be an 'Empty'

PM-me or post a reply if you like to know more (or work together to tackle the problem)

Greatings Jbal

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

Postby mazerrackham » Wed Jul 09, 2008 7:15 am

I'm also trying to find a place to learn some python

also

how is it that you can make the empty a parent and have the camera only point?

My first (and only) theory was you attach a bone to it (camera) and create a track modifier so it always points at the empty

I'm yet to try it but i have some hope

M.R.

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Wed Jul 09, 2008 12:29 pm

Hello M.R.

Learning Python for blender for me started here:
http://wiki.blender.org/index.php/BSoD/ ... _Scripting
I am confident with Delphi-programming, so this looks quite familiar to me.
(Did you do programming before?)

Cameramovement following an Empty
I just tried it and the result was that my camera followed the empty.
There was no need to alter the Empty.

Just try this:

Start blender,
Move the standard cube to a suitable place (I used it as a reverence).

put your graphic-cursor at the origin of the blenderworld (0,0,0),
Add an Empty

Make one viewport your camera-viewport;
check if your emty and the cube are visible.
(I normaly use 4 viewports-, front-,top-,side- and cameraviewport)

Now select your camera first, the Shift-select the empty too,
Type CTRL-P and choose 'make parent'

Now you have to setup the logicbloks in the game-engine to move your empty arround
(I think you know what I am talking about, If not: post again)
If you move the empty now your camera will follow it

You could also read this: http://wiki.blender.org/index.php/Camera_use_in_the_GE

JBal

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

Postby mazerrackham » Sat Jul 12, 2008 10:24 pm

I don't know how to make the empty move by the mouse controlls

OTO
Posts: 430
Joined: Wed Oct 16, 2002 8:51 pm
Contact:

Postby OTO » Sun Jul 13, 2008 11:22 am

Hello to all
the "good" forum for your "game engine" questions, is this one ( game engine section):
http://blenderartists.org/forum/

lots of "goodies" to download, including a "fps template" with camera mouse control, and lots of python scripts/tuts.
Bye

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Sun Jul 13, 2008 9:23 pm

Hi Mr.

The following tutorial will answer your question:
http://wiki.blender.org/index.php/BSoD/ ... ame_Engine

JBal

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

Postby mazerrackham » Thu Jul 24, 2008 9:37 pm

sorry it's taken so long


where in the page are the dirctions for the mouse to make something move?


mr

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Thu Jul 24, 2008 10:39 pm

Hi MR,

There is'nt
But it will tell you how to move things arround with the arrowed keys and to let your camera follow the object.
Look at

Making the default cube move, using no physics

Moving the cube using no physics
Controlling the cube via the arrow keys
Adding in additional keyboard controls
Some GE house keeping
Removing logic blocks and connections


I am stil working on the mouse movement (I want it like in Rome-Total War),
There are some good tutorials on mouse-controlled moving arround on the net , but they do not suit my needs (I think).
Besides figuring these thing out I learn a lot of Python and the use of Python in the Game-Engine. So at least I think time is not wasted.

Greetings to you
JBal

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Fri Jul 25, 2008 12:28 pm

Hi again RM,

download this:
http://members.home.nl/j.j.balster/host ... nt_1.blend

so you can see what I'am working on,
I think it is quite simple after all, but I had to do a lot off reading and trying (and failure) before I got this far.
It is far from perfect; I am still workind on it.
Take care: there are two empties: one to guide the camera and one to hold global variables.
I got lots of information here:
http://www.ibiblio.org/g2swap/byteofpython/read/
http://www.blender.org/documentation/24 ... index.html
http://www.blender.org/documentation/py ... odule.html

I think the last pages hold perfect information for those who are used to program already.
The first pages is perfect for those who want to learn python in the first place.
I don't know if you ever programmed before. Please tell me.

(To understand my script you can skip (delete) the part of working with global-variables in Blender-GE, this is just a part of my learningproces how to use these.
You can also delete the empty not related to the camera)


Greetings to you
JBal

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

Postby mazerrackham » Fri Jul 25, 2008 7:11 pm

I've never heard of Rome-total war

any ways the file you sent me says it's a binary file and can't open
I'm guessing it's because I use a mac and you, something else, but I have no idea for sure.

the sites you've sent me open fine except for the last and 'A byte of Python' looks promising.

M.R.

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Sat Jul 26, 2008 9:15 am

Hi MR,

The file I send you is a .blend file I saved using blender.
I use a microsoft system (windows XP-proffesional). Don't no much of mac's, but I think it it'll be possible to load my file in blender (?) some how.

I'll think about how to send more info.

JBal

mazerrackham
Posts: 7
Joined: Wed Apr 23, 2008 5:25 am

Postby mazerrackham » Sat Jul 26, 2008 4:29 pm

actually the problem isn't blender

it's that my web browsers, safari an fire fox can't open it

any ideas?
i don't have any,yet


MR

jbal
Posts: 12
Joined: Tue Jul 08, 2008 3:56 pm

Postby jbal » Sat Jul 26, 2008 8:52 pm

Use an other browser is an option I think...?

I think we must change to an other board like OTO said; http://blenderartists.org

- There we can get more help on our subject
- and we can PM also, when we have more computer related problems then Blender related questions.
I can mail you my .blend file, but then I have to get your e-mail adress and you don't want that published in a forum (I would'nt) because of the possible spam it can generate.

So lets change to blenderartists.org; I am a member (username Jbal, just like here) PM me when you signed up, or open a thread called 'Mouse directed camera' and ask how this is done in Blender with Python.

Have a nice weekend
Jbal


Return to “Interactive 3d”

Who is online

Users browsing this forum: No registered users and 2 guests