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.

Author
Message
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 9th Mar 2004 07:19
Greetings all! I'm new to DB, but not to programming or 3D modeling.

The question I have should be simple for some of the veterans here:
Is there a way to do simple lines in 3D? ie: line X,Y,Z,X,Y,Z ?
I have seen the 2D line command, but not a 3D counterpart.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 9th Mar 2004 07:29
In 3d you need to use an object. One way to achieve what you wish to achieve is to calculate the length of the vector. You could then take a box shaped object of 1 unit length, scale it along the dimension so its as long as the vector, then position it at the X, Y, Z coordinates of one end point and "point" it at the other X, Y, Z coordinates.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 9th Mar 2004 07:33
I was afraid you were going to say that. Seems like a lot of overhead to display simple lines.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 9th Mar 2004 07:57
Not really. It only takes about 3 or 4 lines of code. If you were doing this just using C++ it'd take you 40 or 50 lines of code.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Mar 2004 09:39
Quote: "Seems like a lot of overhead to display simple lines"


It's the way you think about it. Remember, a line is a 2D concept, not 3D. It would be contradictory to try and create a line in 3D space without adding mass to the line itself (that is, make it an elongated box). As you moved around it, it would disappear at certain angles.

You could use a plain to reduce the number of polygons, but again it would disappear at the wrong angle.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 9th Mar 2004 10:45
@batvink
a line is NOT a 2D concept. By nature, a line (in fact all objects/entities) are 3D concepts, simply because we live in a 3D world. To try to rationalize otherwise is futile. I understand that you are referring to the DB "3D world" as it were, but it's obviously possible using the DB 3D "engine", otherwise wireframe wouldn't be possible (wireframe being nothing more than the drawing of lines between vertexes to represent polygons)
There is apparently not a set of user functions to accomplish this, but it seems to me that something of this nature would be easy to implement by the developers. It just seems strange that the functionality isn't there already.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Mar 2004 13:56
Quote: "a line is NOT a 2D concept"


I would still have to disagree. A line is 2D, as is a circle, a square and a triangle. They have no 3rd dimension.

Yes, you can put a line in 3D space, but it is still a 2D entity. This, I guess is what you were saying, before I threw my spanner into the works. But...If it lies along the X/Z plain, you will not see it if your position is 0 along the Y plain.

Anyway, we are losing the thread
You could create a plain and texture it with a line bitmap. I think this will be as close as you are going to get.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 9th Mar 2004 14:01
With respect, in mathematical terms you are both wrong. A line is neither a 2d nor a 3d concept. A line is a vector. The number of dimensions it has are ultimately irrelevant. Mathematically you can have a 1 dimensional line. That is, of course, a point. Or you could have a 10 dimension line (but thinking about that boggles the mind somewhat).

Anyway all this is by the by. Gaping, the point is that you can create what you want to create very simply by the use of only a few commands. You'd like to create it in only one command. The answer is you can't. It'll take a few more and thats not a big deal.

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 10th Mar 2004 06:57
@philip
I know I can do it using primatives to represent the line segments, but that still seems to me like overkill. For instance, lets say I have a file with 10 distinct, seperate lines in it. Using a scaled box to represent my line, I need 8 vertices and 12 poly's to represent a single line. For my 10 lines, I would need 80 vertices and 120 poly's.
Now imagine this on a much larger scale. Some of the files I'm working with have over 5k lines in them. Using the box to represent the line, I would need 40k vertices and 60k poly's to represent something that I would normally be able to represent using max 10k vertices (most files would use less, since many of the lines share vertices).
I could use plane's instead of boxes, and that would cut down on the verts and poly's, but if I wanted the lines to always be visible, I would have to write code to ensure that they always faced the camera, and that would add overhead.

I realize that a lot of this is probably irrelevant, but it has always been my practice to try to do things using the least amount of resources possible, and to try to write for the "lowest common denominator", and this just seems like using a hammer to kill a fly.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Mar 2004 09:54
I can't think of any 3D graphics app that allows 3D lines. 3D rendering/design apps allow lines and beziers, but they don't actually render, they are only used to facilitate other functionality.

I think the key here is "Solid Geometry". A line is not solid geometry, and I reckon you'll find that 3D cards only support solid Geometry. That would mean that you would have to emulate your 3D line, and you wouldn't be able to interleave it with the true Geometry in the scene.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2004 14:53
Well there IS a way to draw lines in 3d. You basically draw a 2d line that is exactly equivalent to a 3d line. After all a so-called "3d line" is just a 2d line on a computer screen (which is a 2d plane). It just looks 3d to a human eye because of the way our brains interpret our universe.

However, this would take a bit more effort again than just using a plain (which Gaping sensibly suggests as being the least poly intensive method).

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 10th Mar 2004 14:53 Edited at: 10th Mar 2004 14:54
Anyway all this is a bit of a theoretical debate. The main point here is to give a big DBPro community welcome to Gaping. Hello Gaping!! Welcome to the community!!

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P1.3ghz / 384 megs / GeForce MX 5200 128meg / WinXP home
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Mar 2004 20:50
MAKE OBJECT TRIANGLE exists I think. Try that.

"To do is to be" - Descartes
"To be is to do" - Voltaire
"Do be do be do" - Frank Sinatra
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 10th Mar 2004 21:11
he wants a line, not a triangle . you could make a line that's always on top of other objects but I think that's not what you're looking for.



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 11th Mar 2004 04:45
Philip: You're right, this is going towards theoretical debate instead of practical application, and thanks for the welcome!

I think I am going to go with an intersecting-plane representation of the line, as that seems to be the least poly intensive and has a lower possibility of lines disappearing at oblique angles, and I don't have to worry about writing facing code.

Anyway, thanks to all for your input.
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 12th Mar 2004 01:31
Wasnt there a demo that came with DBC that made 3d lines? You could probably use it as a reference.

-Vash the Stampede

"This world is LOVE and PEACE!" -Vash the Stampede

FLY135
20
Years of Service
User Offline
Joined: 26th Feb 2004
Location:
Posted: 12th Mar 2004 04:43
Cube - 3D
Circle = 2D
Line - 1D
Point - 0D

But they can all have a 3D location.
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 12th Mar 2004 05:19 Edited at: 12th Mar 2004 05:30
In C++, with OpenGL atleast, all you would have to do is put GL_Begin(Lines), to make lines. Then again thats how you make any geometry. I guess DBP's system is both good and bad. It keeps track of all the objects for you, but doesent allow basic geometry. If its possible it would be a good feature to have, to make, for example, axis lines in a 3D prog.

There is a create line function in DirectX, however, as well as a couple other objects. Unfortunately, I dont know enough C++ to possibly create a plugin or something.

http://msdn.microsoft.com/library/en-us/directx9_c/directx/graphics/reference/d3dx/functions/shape/d3dxcreateline.asp?frame=true

"All programmers are playwrites and all computers are lousy actors" -Anon
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 12th Mar 2004 05:41
Don't want to add too much heat to the debate, but I've seen gmax, and dreaded blitz3d use 3d lines. In gmax you dragged it where you wanted it to go, and in blitz it went something like this:

LINE3D x1,y1,z1,x2,y2,z2

Crazy Donut Productions
Current Project: KillZone
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 12th Mar 2004 06:44
i suppose you could always just make an object in a modeller, and set it to render as wireframe in DBPro...

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Gaping wound
20
Years of Service
User Offline
Joined: 9th Mar 2004
Location: Vegas Baby!
Posted: 12th Mar 2004 08:14
@Vash
I'm using DBP, and haven't seen anything like that in the tut's or examples.

@andrew & Bear
Yeah, it's pretty basic functionality in most 3D environments and drivers, which is why I'm surprised it's not supported in DBP.

@walaber,
The application I am working on will be used for displaying dynamic datasets, so creating objects before hand is not an option.
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 12th Mar 2004 20:09
@FLY135
Quote: "Cube - 3D
Circle = 2D
Line - 1D
Point - 0D"

how can lines and points be 1D and 0D if they both have a X and Y co-ordinate?



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 12th Mar 2004 22:27
@Mussi
He's referring to the space that each object occupies. A point is commonly used in 2D and 3D geometry, but in "reality", a point has no width, height, depth, time, etc. A line however has one dimension. Circle, 2, (x,y). And a cube has 3 (x,y,z). Furthur, it would be hypercube which has 4 (x,y,z,time), but I dont want to get into another time debate

"All programmers are playwrites and all computers are lousy actors" -Anon
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 13th Mar 2004 06:02
Its a DBC code, may work with DBP or maybe youll need to edit it.



It can also be chopped a lot, as the demo has things besides the line. Dont know if its what your looking for

-Vash the Stampede

"This world is LOVE and PEACE!" -Vash the Stampede

HZence
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 13th Mar 2004 06:46
Quote: "Point - 0D"


Technically a point has to be two dimensions. X is a dimension. Y is a dimension. A point is positioned using X and Y; therefore it is two dimensional.


Team EOD :: Programmer/Storyboard Assistant
CKy
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 13th Mar 2004 06:57
@Gaping Wound (6 posts into the topic)
"simply because we live in a 3D world"

We live in a 4d world. Time is the 4rd axis.
CKy
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 13th Mar 2004 06:58
4th*
FLY135
20
Years of Service
User Offline
Joined: 26th Feb 2004
Location:
Posted: 13th Mar 2004 18:21
Thank you andrew11, you are correct. HZence, a point has no dimensions, no length, width, or height. However you can specify a location that is 2D in a 2D work space or 3D in a 3D world. The difference is "Dimension != Location". That's "not equal" in C talk,
kuban
20
Years of Service
User Offline
Joined: 13th Mar 2004
Location:
Posted: 15th Mar 2004 15:39
To draw lines in 3D space, I guess most of the softwares project the 3D vertex coordinates to 2D space. And then draw lines between the vertices in 2D space. 3D is only used before projection.

I am very new to DPpro. I never used it still... Altough I have worked on OpenGL before. OpenGL just allows 3D coordinates, not 3D lines!

kuban altan
discreet inferno* artist
LReM8888
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: The Land of the Fairies
Posted: 15th Mar 2004 19:17
Simple! You've got to think about how Direct3D (wot DBC+DBP uses) works!!!

To translate a 3D point to a 2D point:

X1= your x value
Y1= your y value
Z1= your z value
Focus= something for fine-tuning

X2= your result x value
Y2= your result y value

<code>

X2 = ( X1 / Z1 ) * Focus
Y2 = ( Y1 / Z1 ) * Focus

This doesn't allow rotation, but using sin() or cos() or something like that you can fix that easily..

Anyways, that should do the trick
jrowe
22
Years of Service
User Offline
Joined: 12th Oct 2002
Location: Here
Posted: 15th Mar 2004 23:44
Actually the latest string theory dictates that space must be 11 dimensional. That's 9 spacial and 1 temporal it's just 6 of the spacial dimensions or curled up around each other so tightly that we don't notice them.

It is generally recognised (if you discount these other dimensions) that a point is 0 dimensional, a line is 1 dimensional, a square is 2 dimensional and a box is 3 dimensional.

Dimensional magnitude has no bearing on an objects position.


For Fathers and Sons who enjoy wholy spirits.
Night Giant
21
Years of Service
User Offline
Joined: 26th Jul 2003
Location:
Posted: 20th Mar 2004 07:40
Quote: "Actually the latest string theory dictates that space must be 11 dimensional. That's 9 spacial and 1 temporal it's just 6 of the spacial dimensions or curled up around each other so tightly that we don't notice them.
"


9+1 = 10, what is the 11th dimension. and where did you read this? it sounds interesting.

oh, wow. insignificantpunks.cjb.net. we like orange treble clef notes, just for future reference.

no: website for progs yet.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 20th Mar 2004 07:54
whats wrong with using a plain(plane)?


Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 20th Mar 2004 15:16
You can't use a 3D object to draw a line, as the 3D object has perspective (ie. the closer part will be bigger than the far away part). You can't use a regular LINE as it doesn't have any ZDepth. I came up with the idea of a 3D line in that post Indi created, I hope it is added to U6.

Trying is the first step towards faliure.
Athelon XP 1600+/Radeon 9600 Pro/256 RAM

Login to post a reply

Server time is: 2024-11-26 09:27:13
Your offset time is: 2024-11-26 09:27:13