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 / 3d object question

Author
Message
SofaKing
9
Years of Service
User Offline
Joined: 6th Nov 2012
Location:
Posted: 5th Dec 2013 21:04
New to DBP. Making a sports game. Created a PLAIN and textured it with a graphic of the field. Came out OK. Then wanted to use spheres to represent players, but when I create a sphere, it appears on a blue background with no field in view. Any ideas? Thanks.
LBFN
15
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 6th Dec 2013 01:09
My thought is that you have autocam on (I think that is the default). What this does is places the camera based upon the last object loaded / created. There are a couple of solutions I can suggest.
1. Leave AUTOCAM on, create the player spheres first and create the playing field last.
2. Use the command AUTOCAM OFF early in your code, place all of the objects and place and aim the camera.

I recommend #2. It can be done something like this:


You can use the arrowkeys to move around. You might have to adjust the values for the camera position some to get it right, as it depends upon how large your plane for the playing field is.

Hope this is helpful. If you still have issues, please post your code (click the CODE button, paste your code, making sure the cursor is at the end, and click the CODE button again) and I will take a look.

So many games to code.....so little time.
SofaKing
9
Years of Service
User Offline
Joined: 6th Nov 2012
Location:
Posted: 6th Dec 2013 03:18
Thanks for reply.

Using suggestion #1: field appears but no sphere.

Using #2: Won't compile.

Here's code (if I do it right):



Thank you.
SofaKing
9
Years of Service
User Offline
Joined: 6th Nov 2012
Location:
Posted: 6th Dec 2013 03:42
Sorry...just messed with size of sphere and position on Z-axis and it did turn up. So, do I understand: the value of the Z for sphere position being more negative moves it closer (beyond field object)?

What I would like to do is place the plain flat (facing up at camera...difficult to describe, I think, with XYZ), so I must position camera to look down at field?

Then I want player spheres to just touch that plain, but not sure what value to give them to place them precisely.

I attempted to rotate and position plain...would it be better to move camera around until it looked down on field?

Thanks for your kind reply.
LBFN
15
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 6th Dec 2013 14:26 Edited at: 6th Dec 2013 14:29
The rotation of the playing field plane needs to be rotated on the X axis 90 degrees. I would suggest you simply place the playing field at 0,0,0 (which is the default) and work from there . Bear in mind that object locations are dead-center, so if your player sphere is 25 units, you would need to place it at 12.5 on the Y axis for it to be placed correctly.

To view it from overhead, move the camera up on the Y axis and point it downward. Take a look at this. You should see the entire playing field on the screen (I colored it green as I don't have your texture) and the sphere is colored red.



I'm sure you'll need to adjust things the way you want, but this shows how you can get setup.

So many games to code.....so little time.
SofaKing
9
Years of Service
User Offline
Joined: 6th Nov 2012
Location:
Posted: 6th Dec 2013 18:40
Thank you. That is perfect. Much to do for now but I'm sure I will be back with more questions. Thank you again.
pcRaider
15
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 7th Dec 2013 00:06
this is sample code


windowsXp

Login to post a reply

Server time is: 2022-06-27 07:24:41
Your offset time is: 2022-06-27 07:24:41