mirror of
https://github.com/storytold/point-generator.git
synced 2026-10-16 00:03:03 +00:00
Point cloud generator
WIP project boilerplate. zeromq work not done.
This commit is contained in:
+15
@@ -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();
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user