Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Trying to create simple follow command with 3d model

Author
Message
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 3rd May 2011 06:26
Hello Everyone,

I am attempting my first "game" by doing the challenge found here: http://forum.thegamecreators.com/?m=forum_view&t=184136&b=7 and I was hoping for some help. I can't seem to get the model to appear on the screen. I thought I was doing everything correctly, but obviously not.

What it is supposed to do is create 100 "bees" on the screen that follow the mouse at varying speeds which is set at the beginning of the program.

All help is appreciated!!!

Attachments

Login to view attachments
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 3rd May 2011 21:08
Hi Bulsatar

I've had a quick look at your code and found a few problems.

First off, the 3ds model crashed the program when I ran it. I replaced it with a cube just to get something running.

Also, the you didn't position camera. This is not always necessary but I like to position and point it to give myself a sense of where things are as sometimes objects may just be placed out of camera shot.

This was not the problem.

In your function, you had:



You missed out a coma between "zMouse as integer" and "MeBee as integer".

Also, the "as integer" bit was cause problems (that may be because I haven't up graded DBP in a while so).

Then, there wasn't a value for speed so it was effectively set to zero so nothing moved.

I've modified you code, just to get something working.





I've not changed the basic way your program works and you may still be disapointed. I think you've got the x, y and z of the mouse and the objects a little confused but I'll leave to sort it out from here on in.

Good luck with the challenge
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 3rd May 2011 23:09
ah, I messed up on the speed variable as it was supposed to be the speed property of the BeeGroup that was passed. I will change that when I get home. I will also take a look at the other additions you made as far as camera and the matrix. I caught the missing comma this morning, but still didn't get it to work...

When I compiled, the program ran for me, I just didn't see the models anywhere. I tried doing procedural textures in 3ds Max, but they didn't transfer over when converted to 3ds format so I might end up doing up some textures for it.

Thanks for taking a look at the code, 29 games. I will post results when I get home from work tonight.
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 4th May 2011 11:35
As this is apart of the challenge I won't help you too much but point you in the right direction for the follow command. Here is a 2D example but you should be able to turn it into 3d without too much trouble. It uses basic trig ratios sin = opp/hyp etc.

The code hasn't been well commented.


A clever person solves a problem, a wise person avoids it - Albert Einstein
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 4th May 2011 14:19
When I ran your initial program all I got was a black screen and then when I tried to close it, it came up with a "program not responding" error. I didn't run the exe, just the code.

If you saw a blue screen but couldn't see any objects, it means that the program is running but all the objects are off camera or out of camera range.

Objects being off camera can get a bit confusing as it's difficult to visually understand where anything is, especially if the objects are moving.

The matrix just gives an easy to code fixed reference point. I pretty much do this at the start of all 3D projects.

When you finally got your program how you like it then you can remove the matrix.

Positioning the camera and pointing it (at a point in space or an object etc) agains helps to orientate yourself in 3D space and gives much greater control on how everything looks on the screen.

The camera position and direction I used in your code was just something I picked so I could see what was happening. You can obviously choose whatever you think looks best.
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 4th May 2011 16:19
Thanks for the tips on the matrix and the camera, much appreciated. I played around with it again last night and got the follow to work almost how I want. The only thing is that the y axis is being reversed for some reason.
I still can't get that file to load and I don't know why. The poly count is less than 6000. I tried to get it to just open 1 instance of it and I can't do that either. Is there something I have to do when exporting in 3ds Max to get it to work correctly?

**if you want to check out the follow command and how it works, just left click to gather the squares to you.

Thanks for the help, always appreciated!

Attachments

Login to view attachments
Bulsatar
13
Years of Service
User Offline
Joined: 19th Apr 2011
Location:
Posted: 4th May 2011 16:20
Woohoo, can I get a holla for being out of the noob stage on the forum!!!

Login to post a reply

Server time is: 2024-11-22 23:42:12
Your offset time is: 2024-11-22 23:42:12