Point cloud generator

WIP project boilerplate. zeromq work not done.
This commit is contained in:
Brandon Thomas
2021-01-11 23:56:30 -05:00
commit c4da7892ee
6 changed files with 159 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
mod point;
use point::Point;
fn main() {
let ctx = zmq::Context::new();
let socket = ctx.socket(zmq::REQ).unwrap();
let point = Point::white_at(0.0f32, 0.0f32, 0.0f32);
socket.connect("tcp://127.0.0.1:1234").unwrap();
socket.send("hello world!", 0).unwrap();
}
+27
View File
@@ -0,0 +1,27 @@
pub struct Point {
pub x: f32,
pub y: f32,
pub z: f32,
_unused: f32,
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
impl Point {
pub fn white_at(x: f32, y: f32, z: f32) -> Self {
Point {
x,
y,
z,
_unused: 0.0f32,
r: 1.0f32,
g: 1.0f32,
b: 1.0f32,
a: 1.0f32,
}
}
}