Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1409952 Posts in 69136 Topics- by 62799 Members - Latest Member: KarhuNinja

December 11, 2023, 07:43:55 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General thread for quick questions
Pages: 1 ... 67 68 [69]
Print
Author Topic: General thread for quick questions  (Read 123885 times)
a-k-
Level 2
**


View Profile
« Reply #1360 on: February 02, 2023, 07:23:19 PM »

For the general case:
1. y = ax+b
2. (x%1 - 0.5)² + (y%1 - 0.5)² < 0.1

Translate the line to get rid of the two 0.5's.
"Inflate" it so that it has a thickness of 2*sqrt(0.1).
Let y1 and y2 be the upper and lower outlines of the thick line.

For any integer x0:
- For any integer y0 in the open interval (y1, y2):
- - (x0, y0) is the origin of a circle intersecting the translated line
- - Calculate its 2 intersections with the translated line
- - Translate back to the original coordinates system

Edit: more details
« Last Edit: February 02, 2023, 08:03:11 PM by a-k- » Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1361 on: February 03, 2023, 08:03:02 AM »

Thanks, there is some interesting ideas.

I forgot to specify I was trying to get rid of for loop because shader... I guess this is no longer a quick question and I should open a thread ... I'm looking for a result in form of kf(x), in which k give the kth hit, as a generalization of ddx algorithm, but on "concave" primitive instead of line or plane.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1362 on: March 24, 2023, 11:21:32 AM »

I made a thread: probably not solvable ?
https://forums.tigsource.com/index.php?topic=74410.0

I solved first hit before applying my wrapping trick, but once the ray wrapped vertically (using minor axis symmetry to select the vertical), finding other hit for n wrap in fixed step (no loop aka no raymarch) seems like a tall order.
Logged

Pages: 1 ... 67 68 [69]
Print
Jump to:  

Theme orange-lt created by panic