This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuREM Format
REM : (a colon)
REM shape1_name
REM front_laser_vertex_number
REM qty_vertices, qty_faces
REM "vertices"
REM vertex1_x, vertex1_y, vertex1_z
REM vertex2_x, vettex2_y, vertex2_z
REM ......et al ....
REM "faces"
REM face1_colour,face1_normalx,face1_normaly,face1_normalz,
REM face1_vertexqty,face1_1st_vertex_number,face1_2nd_vertex_number ...
REM face2_colour,face2_normalx,face2_normaly,face2_normalz,
REM face2_vertexqty,face2_1st_vertex_number,face2_2nd_vertex_number ...
REM ......et al ....
REM "hue-lig-sat"
REM 15 colour definitions
REM shape2_name .....
REM ...
REM Note: &xx denotes a hex number
:
ADDER
&00
&12,&0E
vertices
-&12,&00,&28
&12,&00,&28
&1E,&00,-&18
&1E,&00,-&28
&12,-&07,-&28
-&12,-&07,-&28
-&1E,&00,-&28
-&1E,&00,-&18
-&12,&07,-&28
&12,&07,-&28
-&12,&07,&0D
&12,&07,&0D
-&12,-&07,&0D
&12,-&07,&0D
-&0B,&03,&1D
&0B,&03,&1D
&0B,&04,&18
-&0B,&04,&18
faces
&00,&00,&27,&0A,4,11,10,0,1
&00,&00,-&27,&0A,4,13,12,0,1
&03,&45,&32,&0D,3,2,11,1
&02,&45,-&32,&0D,3,2,13,1
&04,&1E,&34,&00,4,9,11,2,3
&05,&1E,-&34,&00,4,4,13,2,3
&06,&00,&00,-&A0,6,3,4,5,6,8,9
&04,-&1E,&34,&00,4,10,8,6,7
&05,-&1E,-&34,&00,4,12,5,6,7
&03,-&45,&32,&0D,3,10,7,0
&02,-&45,-&32,&0D,3,12,7,0
&0B,&00,&1C,&00,4,10,11,9,8
&0B,&00,-&1C,&00,4,12,13,4,5
&0D,&00,&27,&0A,4,17,14,15,16
hue-lig-sat
&2D,&02,&07
&00,&00,&07
&20,&02,&0F
&1D,&05,&09
&25,&04,&0A
&0F,&02,&0F
&00,&07,&0F
&00,&00,&07
&00,&00,&07
&00,&00,&07
&00,&00,&07
&3C,&03,&07
&00,&00,&00
&0F,&07,&0F
&00,&00,&07
import numpy as np
def hex_to_dec(hex_str):
hex_str = hex_str.replace('&', '') # Remove '&' character
return int(hex_str, 16) if hex_str[0] != '-' else -int(hex_str[1:], 16)
# Parse vertices
vertices_hex = [
"-&12,&00,&28", "&12,&00,&28", "&1E,&00,-&18", "&1E,&00,-&28", "&12,-&07,-&28",
"-&12,-&07,-&28", "-&1E,&00,-&28", "-&1E,&00,-&18", "-&12,&07,-&28", "&12,&07,-&28",
"-&12,&07,&0D", "&12,&07,&0D", "-&12,-&07,&0D", "&12,-&07,&0D", "-&0B,&03,&1D",
"&0B,&03,&1D", "&0B,&04,&18", "-&0B,&04,&18"
]
vertices = []
for vertex in vertices_hex:
x, y, z = vertex.split(',')
vertices.append((hex_to_dec(x), hex_to_dec(y), hex_to_dec(z)))
# Parse faces
faces_hex = [
"&00,&00,&27,&0A,4,11,10,0,1", "&00,&00,-&27,&0A,4,13,12,0,1", "&03,&45,&32,&0D,3,2,11,1",
"&02,&45,-&32,&0D,3,2,13,1", "&04,&1E,&34,&00,4,9,11,2,3", "&05,&1E,-&34,&00,4,4,13,2,3",
"&06,&00,&00,-&A0,6,3,4,5,6,8,9", "&04,-&1E,&34,&00,4,10,8,6,7", "&05,-&1E,-&34,&00,4,12,5,6,7",
"&03,-&45,&32,&0D,3,10,7,0", "&02,-&45,-&32,&0D,3,12,7,0", "&0B,&00,&1C,&00,4,10,11,9,8",
"&0B,&00,-&1C,&00,4,12,13,4,5", "&0D,&00,&27,&0A,4,17,14,15,16"
]
def parse_face(face_str):
components = face_str.split(',')
normal = [hex_to_dec(components[1]), hex_to_dec(components[2]), hex_to_dec(components[3])]
vertex_count = int(components[4])
vertex_indices = [int(components[i + 5]) for i in range(vertex_count)]
return normal, vertex_indices
faces = [parse_face(face) for face in faces_hex]
# Function to check if face is clockwise
def is_face_clockwise(vertices, normal, vertex_indices):
v1 = np.array(vertices[vertex_indices[0]])
v2 = np.array(vertices[vertex_indices[1]])
v3 = np.array(vertices[vertex_indices[2]])
# Calculate the normal using cross product
edge1 = v2 - v1
edge2 = v3 - v1
face_normal = np.cross(edge1, edge2)
# Normalize the face normal
face_normal = face_normal / np.linalg.norm(face_normal)
# Compare the calculated normal with the provided normal
dot_product = np.dot(face_normal, normal)
return dot_product < 0
# Check each face
clockwise_faces = []
for i, (normal, vertex_indices) in enumerate(faces):
if is_face_clockwise(vertices, normal, vertex_indices):
clockwise_faces.append(i)
# Print the results
print("Clockwise-oriented faces:", clockwise_faces)
Key: A "YES" beside your name means you're on the update list.
(sent) means you have the latest version
2600fish
2600Gaming
Al_Nafuur
YES alex_79 (sent)
amidarman
Arcadia2600
Atari7800+
Bkillar
BogPanda (sent)
Bomberman94
YES Bomza (sent)
YES CODEYE (sent)
Conjurershand
YES Crossbow (sent)
cubelindo
cwieland
D Train
danreinfeld (sent)
Darryl1970
Der_Justy
devwebcl
dionoid
dipppinnn
Doctor_Scott (sent)
doug0909
dravensth
Ducky
YES EightBitWhit (sent)
Fierodoug5
GenXGrownUp
Giuseppe
YES GlennMain (sent)
Godzilla
guppy
Hjou
HolmesA8
hwen
YES imstarryeyed (sent)
Jason_Atari
JetmanUK
Kaboomer
Kevinmos3
YES killersquirrel (sent)
YES Lazzeri (sent)
Leepy (sent)
legeek
lroby74
YES luminol (sent)
Marc Oberhäuser
YES markzilla1985 (sent)
MattelAquarius
YES McCallister (sent)
mccollumsp
MGG (sent)
Miccoli Marco
YES Mike.Littau (sent)
Mitch.h
MrZarniwoop
NISMOPC
pazuzu72
philenotfound
YES Philsan (sent)
YES Piotr (sent)
Poestylr (sent)
Prizrak
productof76
quohog
radventure
ramblingdan
Retro Bliss (sent)
RetroDean1966 (sent)
Retro Jason24
YES RickR (sent)
YES scumation (sent)
silvio mogno
Sockboy
YES somebooks (sent)
songbird
YES SpiceWare (sent)
spspspsp
YES sramirez2008 (sent)
StLouisRod
The_Road_Warrior
YES TheRingBearer (sent)
tlindner (sent)
YES TreatBucket
TrekMD
Trifalger
YES UberArcade (sent)
Vagrant
Willbert
YES Xkenx70 (sent)
yurgle
YES Zack (sent)
ziggystar12