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.

DarkBASIC Discussion / 3D Lines?

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th May 2009 16:25
Hello there!

I am trying to make 3D lines with 2D commands, but it lags after about 4 lines and I certainly can't use this for 500 lines. Is there another way?

Here is the code for my "3D Lines" using 2D commands:


The code is media-less.

TheComet

Peachy, and the Chaos of the Gems

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th May 2009 03:32 Edited at: 10th May 2009 03:43
ooh ooh ooh Latch let me do this one
I have to find my code first.

[edit]
Ah no this isn't what I thought you meant.
You can use trigonometry to work out the 2D location of a 3D point (like I managed to with latch's help) but I'm not sure if that would help speed.
You also have a moving camera and I didn't get that far so I'll leave it to Latch or one of the other boffins.

Riddle: The more you take, the more you leave behind. What are they? Answer
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 10th May 2009 03:59 Edited at: 10th May 2009 04:10
hmmmmm, just a thought but maybe u could make a 3d mesh using memblocks and the other objects 3d coordinates, then put it in wireframe mode, only problem is that the lines would have to be white

[edit]
or just make 3d triangles using the x,y,zs of the spheres and again, put it in wireframe mode

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th May 2009 16:19
Quote: "or just make 3d triangles using the x,y,zs of the spheres and again, put it in wireframe mode"

That's a great idea, That1Smart Guy. And probably easy on the processing.

Enjoy your day.
Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 13th May 2009 21:05
Quote: "then put it in wireframe mode, only problem is that the lines would have to be white"

Actually, wireframe lines aren't always white. If you texture a 3d object (I think colouring the object may work as well, but I'm not sure) then when you switch to wireframe view, the lines take on the color of the texture at that point.

So, for example, if you had a rainbow texture applied to a wireframe plain, the lines would shift from Red orange, yellow, etc. to blue.

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th May 2009 07:14
I didn't know that! sweet!

New Site! Check it out \/
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 14th May 2009 20:57
Works! Thanks!

TheComet

Peachy, and the Chaos of the Gems

Login to post a reply

Server time is: 2025-05-14 21:09:50
Your offset time is: 2025-05-14 21:09:50