generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Way to get all pixels in a 3D line

Previous Thread :: Next Thread 
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
29 Nov 2011 09:46 PM
I know quite a few capable people post here, so I might as well ask here.

So we have two vectors, what's the most efficient way to only get all the pixels on the line, which are whole numbers of course. Slopes don't always get all the pixels, though there may be a way to change the slope to do so. I haven't really done stuff like this before much, lol.
Report Abuse
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
29 Nov 2011 10:17 PM
>  to only get all the pixels on the line, which are whole numbers of course.

pixels on a 3D line?
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
29 Nov 2011 11:16 PM
It only has to APPEAR 3D. Look into perspective.

It's a love-hate relationship....
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
29 Nov 2011 11:54 PM
I have looked into perspective, yet I'm asking something totally different.
Report Abuse
eyeontheprizeREBOOT is not online. eyeontheprizeREBOOT
Joined: 30 Jan 2011
Total Posts: 1555
30 Nov 2011 12:26 AM
Do you mean voxels? Pixels do not exist in 3D space.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
30 Nov 2011 01:30 AM
Oh, never mind. I would suggest slope.. + math.

It's a love-hate relationship....
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
30 Nov 2011 06:13 AM
First, you would move the points to 2D, draw the line using whatever algorithm, and for each pixel you would take its position on the 2D line and move it back to 3D
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
30 Nov 2011 06:14 AM
Nowait...

Youre wanting to draw a line or wat?

In that case u google "best line rasterizing alg0rithm pl0x"
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
30 Nov 2011 09:31 AM
Kthx.

So Bresenham's algorithm seems to be the simplest.
Report Abuse
DragonFang1 is not online. DragonFang1
Joined: 02 Apr 2009
Total Posts: 1068
30 Nov 2011 11:57 AM
Region3()
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
30 Nov 2011 11:59 AM
I have no idea what you are asking
Report Abuse
HotThoth is not online. HotThoth
Forum Moderator
Joined: 24 Aug 2010
Total Posts: 1176
30 Nov 2011 12:38 PM
Not sure if you want voxels or pixels. Do you want an algorithm to step through all of the 1x1 3-dimensional cubic regions that the line crosses, or an algorithm to step through all of the 2D pixels on your screen that the line would cross given that your camera is at some particular position with a given field of view? My guess is the first, in which case, yes, you want some rasterization algorithm.

One way of approaching the rasterization problem from a geometric standpoint is to calculate ray/axis-aligned-bounding-box collisions (start with ray/plane collisions). Which rasterization approach to use depends on what type of line you want to get. For example: is it ok if the line steps from (0,0,0) to (1,1,1) or should it have to pass through other points first?
Report Abuse
myrkos is not online. myrkos
Joined: 06 Sep 2010
Total Posts: 8072
30 Nov 2011 05:09 PM
Yeah, I meant voxels, which I guess can be considered as 3D pixels. :p

I figured though, that I could just project the beginning and end of the line to a 2D plane and then draw the rest of it in on the plane. Thanks though.
Report Abuse
THEAVENGER119 is not online. THEAVENGER119
Joined: 14 Jun 2009
Total Posts: 59015
30 Nov 2011 05:19 PM
Holy crap

Ineedtolrntoscript
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image