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 / my first array with a slight problem

Author
Message
Shay3000
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location:
Posted: 16th Aug 2008 08:31 Edited at: 16th Aug 2008 08:38
here is my source code for my array Note: it's not perfect but its a start for me i'm still learning

try my source code to see the issue I'm having :_

Quote: "
REM Project: ShaysFirstArrays2
REM Created: 7/30/2008 6:42:57 AM
REM Author: Shaylan Mackay 2008
REM ***** Main Source File *****
REM

sync on : sync rate 60
color backdrop 0 : hide mouse
set display mode 640,480,32
set camera range .80,0
`pitch camera down 32

` Setup array
dim boxes(6)

dim boxes(1) = box1
dim boxes(2) = box2
dim boxes(3) = box3
dim boxes(4) = box4
dim boxes(5) = box5
dim boxes(6) = box6

` model position variables
x# = posx = rnd(.255)
y# = posy = rnd(.255)
z# = posz = rnd(.255)
`z2# is the only position variable
`Z2# that is only for back center
z2# = posz = rnd(.4)

`Load all media here
box1=1
load object "box.x",box1
position object box1,-x#,0,0
set object smoothing 1,100
`scale object box1,1,1,1

box2=2
load object "box.x",box2
position object box2,x#,0,0
set object smoothing 2,100
`scale object box2,2,2,2

box3=3
load object "box.x",box3
position object box3,-x#,0,z#
set object smoothing 3,100
`scale object box3,2,2,2

box4=4
load object "box.x",box4
position object box4,x#,0,z#
set object smoothing 4,100
`scale object box4,2,2,2

box5=5
load object "box.x",box5
position object box5,-x,0,z
set object smoothing 5,100
`scale object box5,2,2,2

box6=6 ` this one is center back
load object "box.x",box6
position object box6,0,0,z2#
set object smoothing 6,100
`scale object box5,2,2,2

` All textures go here
load image "1.bmp",1
load image "2.bmp",2
load image "3.bmp",3
load image "4.bmp",4
` Apply textures to object
texture object 1,1
texture object 2,2
texture object 3,3
texture object 4,4
` Adjust texture appearance


` **** Main Loop ****
do

if keystate(203) then turn camera left .5 ` Left arrow key
if keystate(205) then turn camera left -.5 ` Right arrow key
if keystate(200) then move camera .005 ` Up arrow key
if keystate(208) then move camera -.005 ` Down arrow key
sync

loop
end

"


the problem for me is my models load up fine

in one angle they look straight and perfect but on the left and right they're slightly off from being straight and flat instead
they're look like they're rolling turn or a pitch turn

all they are simple square cubes nothing fancy
please help resolve this slightly small issue

plus rotate object doesn't seem to work for me
but I'm thinking that its my model position
variables but I'm not so sure please help me

P.S the z2# = posz = rnd(.4) variable is only for
the back center row of cubes.

cubes in the middle only

I'll wait for your replies

Shay3000
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Aug 2008 16:11
These lines probably don't work as you intend:

As you haven't set any of the box variables at that point, their current contents of zero will be stored in the array.

I'm a little confused about your problem though, because that sounds like standard 3D perspective to me - if you stand at the front of a car facing it, you can't see the sides. If you then move 5 feet to the side without changing the direction you are facing, you can now see the side.

If you want to avoid that and always have the boxes facing you directly, then you could use the POINT OBJECT command on each object with your current camera position as the point for each object to point to.


Shay3000
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location:
Posted: 16th Aug 2008 22:34 Edited at: 16th Aug 2008 22:37
yes it was a standard 3D perspective problem

Quote: "
point object box1, camera position x(), camera position y(), camera position z()"


the point object command fixed the problem thanks

my other problem now is when u have one object in front of an other

the object in front u can see thru it kind of and see the other object behind is that normal

I've been doing a horrible job of explaining things to people lately sorry about that

Shay3000
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Aug 2008 17:49
Why not show us a screenshot, or better still, post runnable code we can try?

Shay3000
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location:
Posted: 18th Aug 2008 01:21 Edited at: 18th Aug 2008 05:43
Here's a pic for u enjoy



where u see the red arrow pointing to it's been doing it to my
models in .x format and .3ds .obj too it's a dark basic pro glitch
it comes and goes this glitch only happens in dbpro update v70 also in
v70 when going to the compilers help tab in dbpro it still says

v1.069 not v70 just thought I let u know

p.s Also rotate object doesn't work

would there be another way to position them and keep them straight
and flat without having to point them at the camera

Shay3000
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Aug 2008 20:01
Try running the update again and clicking on the 'repair' option - if the value shown in the editor doesn't give you the correct version then the update hasn't updated correctly.

Shay3000
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location:
Posted: 19th Aug 2008 05:06 Edited at: 19th Aug 2008 05:07
here is my array source code and files with some minor adjustments which are ok for a beginner not a pro the other problem is my model
box.x file loads up fine with textures but you can see thru it
and see the other cube or cubes behind it

http://freewebs.com/tokien1/myfirstarray.zip

give it a try and see if u can help me improve it

P.S the pitch object up is in there because the cubes tilting forward
a little

Shay3000
Shay3000
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location:
Posted: 19th Aug 2008 23:13 Edited at: 19th Aug 2008 23:14
Quote: "
Try running the update again and clicking on the 'repair' option - if the value shown in the editor doesn't give you the correct version then the update hasn't updated correctly."


I did that five times and still it says v1.069 not v1.070
and yes its a beta version

its in:
DarkBASIC Professional Discussion

by Lee bamber

Shay3000
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Aug 2008 23:44
All that I can suggest now is that you send the link to Lee (lee@thegamecreators.com) or post details in that beta thread of his.

As it runs just fine in 6.9, the only things that can be wrong here are that 7.0 hasn't installed properly for you, or that there's something broken in its 3D handling - either of these would need to be fixed properly before 7.0 is released for real.

Login to post a reply

Server time is: 2024-11-25 18:25:17
Your offset time is: 2024-11-25 18:25:17