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 Objects Onto Matrix

Author
Message
Burke Zillar
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location:
Posted: 17th Mar 2004 22:05
I need a code that will enable me to put 3D objects onto a matrix. I created a matrix using MatEdit 1.6b, and the 3D objects using 3D Canvas. For some reason, I cannot load the 3D objects onto the matrix. They still load, but they are took off the screen when the matrix appears. There isn't a code in the Dark Basic reference guide that tells me how to do this. The only codes are 'Append Object', 'Load Object', and 'Position Object'. None of which work for putting a 3D object on the matrix.

P.S: The 3D Files are in .X file format.

P.P.S: One person has given me a code which doesn't work. I think it has something to do with the order of coding. Do I put the 3D Load Object Code before or after the matrix code?
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 17th Mar 2004 23:21 Edited at: 17th Mar 2004 23:27
load the objects and the matrix as you like, then you need to scale and position the objects, what will be happening at the moment is that the objects are "under" the matrix or in another position in 3d space that you are not pointing the camera at, and you need to relocate them to a position where you can see them, do the following

load the matrix
load an object
get the ground height at the x/z position you plan to position the object at
position the object at the x,groundheight,z position
if the object is too large or too small then alter the scale with the scale command
point the camera at this position (you might have to move the camera up into the air and away from the position to see the model properly)

if the object is realy tiny or massive then it may be too big/small to see, start off with the object at one unit size, you can make the size one unit by dividing 100 by the object size and then using the result to scale the model, also if the object and the camera share the same position then you may not be able to see the object since the camera would be inside it and for speed reasons DB removes any faces that face away from the camera, also note that the reference point that positions the object may be in the middle (ie a soldier may have the zero position in his stomach, so you may have to add a fixed value to his height to get all of him on top of the ground, cheers.

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, ATI radeon 9800 pro gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster, ups.

Login to post a reply

Server time is: 2024-11-26 09:38:06
Your offset time is: 2024-11-26 09:38:06