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.

3 Dimensional Chat / Aligning objects *PERFECTLY*

Author
Message
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 20th Sep 2003 19:09
Hi all, I need to be able to align a series of .x objects (EG walls) perfectly on a 3d matrix grid. I need to have all the wall pieces in different sections so that I can hide ones that arent in use. Can anybody provide me with a little piece of code?

I dont want any seams at all between them, I cant use the CSG command because it would prevent me from hiding different pieces and, although this is a relatively easy topic, I'm unsure on how to get objects to line up perfectly because I dont know at what 3d coords they join up. If you know what I mean.

Thanks in advance.

"It's amazin' what you can do with a computer and access to t'internet"
APEXnow
Retired Moderator
22
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 20th Sep 2003 22:08
M00NSHiNE,

It would make the job easier if you knew what the size of the bounding area for each model was, you could use OBJECT SIZE, but this uses a spherical size to encompass the whole model, which isn't very good for cubed models. If you created the models yourself, can you obtain the bounding areas for each one, and use this as the reference for lining up each model along the preferred axis using SET OBJECT POSITION?


indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 21st Sep 2003 03:50
say you had 10 zones that are 1 space in size each.

[][][][][][][][][][]

and a series of cubes thats a size of 1 []

you can write a loop to place a series of them in a row

for i = 1 to 10
position object i,0,0,(0.5-i)
next i

the -0.5 offsets it into the correct position since its half of the cube size.


now before u can use it as a csg model u need to save all the cubes into one x file with save mesh. dont use any complex parent child heirachies.



then use this command.

COMPILE CSG
This command will convert a specially designed X file into a CSG processed geometry set and save it out as
an output X file. The input X file has to consist of a series of solid meshes with no complex frame
hierarchy. The Constructive Solid Geometry process will split these meshes to remove all hidden surfaces.
This can save polygons in large scenes, but may also increase polygon counts if the geometry is complex.
A typical example of a good input X file is a sequence of solid boxes placed side by side to form a wall. CSG
would remove the polygons where the boxes touch reducing the polygon count and improving polygon
usage.

SYNTAX
COMPILE CSG Input X File, Output X File
COMPILE CSG Input X File, Output X File, Epsilon

http://www.lunarpixel.com
It's already tomorrow in Australia
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 21st Sep 2003 05:19
Thanks for that guys, I'll work on it.

"It's amazin' what you can do with a computer and access to t'internet"

Login to post a reply

Server time is: 2025-06-26 20:27:12
Your offset time is: 2025-06-26 20:27:12