Giter Site home page Giter Site logo

kiss3d's People

Contributors

1011x avatar alon avatar alvinhochun avatar andor44 avatar borgel avatar boxofrox avatar candunc avatar dhardy avatar dllu avatar dmweis avatar dns2utf8 avatar donkeyteethux avatar guccialex avatar henryswanson avatar jaredly avatar jerry73204 avatar joshlambda avatar mkovaxx avatar mrrobb avatar natal avatar nicozet avatar oli-obk avatar raduberinde avatar rosievers avatar rparrett avatar samoylovfp avatar sebcrozet avatar serprex avatar svenlinden avatar wackywendell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kiss3d's Issues

Linker error on OS X

dev ➤ git clone --recursive git://github.com/sebcrozet/kiss3d.git
Cloning into 'kiss3d'...
remote: Reusing existing pack: 3137, done.
remote: Counting objects: 261, done.
remote: Compressing objects: 100% (256/256), done.
remote: Total 3398 (delta 160), reused 0 (delta 0)
Receiving objects: 100% (3398/3398), 2.45 MiB | 857.00 KiB/s, done.
Resolving deltas: 100% (2306/2306), done.
Checking connectivity... done.
Submodule 'lib/gl-rs' (git://github.com/sebcrozet/gl-rs.git) registered for path 'lib/gl-rs'
Submodule 'lib/glfw-rs' (https://github.com/sebcrozet/glfw-rs.git) registered for path 'lib/glfw-rs'
Submodule 'lib/nalgebra' (https://github.com/sebcrozet/nalgebra.git) registered for path 'lib/nalgebra'
Submodule 'lib/ncollide' (git://github.com/sebcrozet/ncollide.git) registered for path 'lib/ncollide'
Submodule 'lib/rust-ffmpeg' (git://github.com/sebcrozet/rust-ffmpeg.git) registered for path 'lib/rust-ffmpeg'
Submodule 'lib/rust-freetype' (git://github.com/sebcrozet/rust-freetype.git) registered for path 'lib/rust-freetype'
Submodule 'lib/rust-stb-image' (https://github.com/sebcrozet/rust-stb-image.git) registered for path 'lib/rust-stb-image'
Cloning into 'lib/gl-rs'...
remote: Reusing existing pack: 938, done.
remote: Counting objects: 55, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 993 (delta 18), reused 31 (delta 7)
Receiving objects: 100% (993/993), 1.88 MiB | 876.00 KiB/s, done.
Resolving deltas: 100% (429/429), done.
Checking connectivity... done.
Submodule path 'lib/gl-rs': checked out '708ba0dc29738e7dd95fb93a40a0f5ed4e3a91c9'
Submodule 'deps/glfw-rs' (https://github.com/bjz/glfw-rs.git) registered for path 'deps/glfw-rs'
Submodule 'deps/khronos-api' (https://github.com/bjz/khronos-api.git) registered for path 'deps/khronos-api'
Submodule 'deps/sax-rs' (https://github.com/bjz/sax-rs.git) registered for path 'deps/sax-rs'
Cloning into 'deps/glfw-rs'...
remote: Reusing existing pack: 3266, done.
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 3283 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (3283/3283), 906.46 KiB | 819.00 KiB/s, done.
Resolving deltas: 100% (1683/1683), done.
Checking connectivity... done.
Submodule path 'lib/gl-rs/deps/glfw-rs': checked out '61518cbd524d33411622c86352e9b4343b4fee90'
Cloning into 'deps/khronos-api'...
remote: Reusing existing pack: 1272, done.
remote: Total 1272 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1272/1272), 2.17 MiB | 1004.00 KiB/s, done.
Resolving deltas: 100% (1116/1116), done.
Checking connectivity... done.
Submodule path 'lib/gl-rs/deps/khronos-api': checked out '95c43bdb7dd4e69145fa0025d142cec7cae89349'
Cloning into 'deps/sax-rs'...
remote: Reusing existing pack: 391, done.
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 399 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (399/399), 84.00 KiB | 0 bytes/s, done.
Resolving deltas: 100% (197/197), done.
Checking connectivity... done.
Submodule path 'lib/gl-rs/deps/sax-rs': checked out 'a5ae75fa386534226c8c3082c607b696c2c30382'
Cloning into 'lib/glfw-rs'...
remote: Counting objects: 3326, done.
remote: Compressing objects: 100% (1441/1441), done.
remote: Total 3326 (delta 1703), reused 3307 (delta 1695)
Receiving objects: 100% (3326/3326), 909.69 KiB | 860.00 KiB/s, done.
Resolving deltas: 100% (1703/1703), done.
Checking connectivity... done.
Submodule path 'lib/glfw-rs': checked out '61518cbd524d33411622c86352e9b4343b4fee90'
Cloning into 'lib/nalgebra'...
remote: Reusing existing pack: 3452, done.
remote: Total 3452 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3452/3452), 1.76 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (2182/2182), done.
Checking connectivity... done.
Submodule path 'lib/nalgebra': checked out '997cd4f888f86c2f566c8c7343be14528ce344b2'
Cloning into 'lib/ncollide'...
remote: Reusing existing pack: 11168, done.
remote: Counting objects: 52, done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 11220 (delta 10), reused 0 (delta 0)
Receiving objects: 100% (11220/11220), 3.36 MiB | 1.37 MiB/s, done.
Resolving deltas: 100% (8631/8631), done.
Checking connectivity... done.
Submodule path 'lib/ncollide': checked out '7e58377b421eae4b298c8e53dc4d6085efaececb'
Submodule 'nalgebra' (git://github.com/sebcrozet/nalgebra) registered for path 'nalgebra'
Cloning into 'nalgebra'...
remote: Reusing existing pack: 3452, done.
remote: Total 3452 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3452/3452), 1.76 MiB | 1.16 MiB/s, done.
Resolving deltas: 100% (2182/2182), done.
Checking connectivity... done.
Submodule path 'lib/ncollide/nalgebra': checked out '997cd4f888f86c2f566c8c7343be14528ce344b2'
Cloning into 'lib/rust-ffmpeg'...
remote: Reusing existing pack: 352, done.
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 384 (delta 8), reused 19 (delta 5)
Receiving objects: 100% (384/384), 199.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (167/167), done.
Checking connectivity... done.
Submodule path 'lib/rust-ffmpeg': checked out 'af16cd0f5f217d25615793f8f86a0be33b10b8a4'
Cloning into 'lib/rust-freetype'...
remote: Reusing existing pack: 233, done.
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 250 (delta 7), reused 4 (delta 0)
Receiving objects: 100% (250/250), 60.29 KiB | 0 bytes/s, done.
Resolving deltas: 100% (133/133), done.
Checking connectivity... done.
Submodule path 'lib/rust-freetype': checked out 'b4f6f7a4a0b99eeccd14c45ba6436debb2fd90a2'
Cloning into 'lib/rust-stb-image'...
remote: Counting objects: 318, done.
remote: Compressing objects: 100% (145/145), done.
remote: Total 318 (delta 171), reused 318 (delta 171)
Receiving objects: 100% (318/318), 98.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (171/171), done.
Checking connectivity... done.
Submodule path 'lib/rust-stb-image': checked out 'b91a0d0f4143cd950b59625fc91173025932703d'
dev ➤ cd kiss3d
kiss3d ➤ make deps                                                                                                                                git:master
make lib -C lib/glfw-rs
sh etc/link-rs.sh "-lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo " > src/link.rs
mkdir -p lib
rustc  --out-dir=lib -O src/glfw.rs
make -C lib/nalgebra
mkdir -p lib
rustc src/lib.rs --out-dir lib --opt-level 3
rustc src/lib.rs --out-dir lib --crate-type dylib --opt-level 3
make deps -C lib/ncollide
make -C nalgebra
mkdir -p lib
rustc src/lib.rs --out-dir lib --opt-level 3
rustc src/lib.rs --out-dir lib --crate-type dylib --opt-level 3
make 3df32 -C lib/ncollide
mkdir -p lib
rustc src/ncollide3df32.rs -L./nalgebra/lib --out-dir lib --opt-level 3 --cfg dim3
src/narrow/bezier_surface_bezier_surface.rs:55:26: 55:28 warning: unused variable: `ma`, #[warn(unused_variable)] on by default
src/narrow/bezier_surface_bezier_surface.rs:55     fn update(&mut self, ma: &Matrix, a: &BezierSurface, mb: &Matrix, b: &BezierSurface) {
                                                                        ^~
src/narrow/bezier_surface_bezier_surface.rs:55:39: 55:40 warning: unused variable: `a`, #[warn(unused_variable)] on by default
src/narrow/bezier_surface_bezier_surface.rs:55     fn update(&mut self, ma: &Matrix, a: &BezierSurface, mb: &Matrix, b: &BezierSurface) {
                                                                                     ^
src/narrow/bezier_surface_bezier_surface.rs:55:58: 55:60 warning: unused variable: `mb`, #[warn(unused_variable)] on by default
src/narrow/bezier_surface_bezier_surface.rs:55     fn update(&mut self, ma: &Matrix, a: &BezierSurface, mb: &Matrix, b: &BezierSurface) {
                                                                                                        ^~
src/narrow/bezier_surface_bezier_surface.rs:55:71: 55:72 warning: unused variable: `b`, #[warn(unused_variable)] on by default
src/narrow/bezier_surface_bezier_surface.rs:55     fn update(&mut self, ma: &Matrix, a: &BezierSurface, mb: &Matrix, b: &BezierSurface) {
                                                                                                                     ^
src/partitioning/dbvt.rs:155:23: 155:42 warning: private type in exported type signature, #[warn(visible_private_types)] on by default
src/partitioning/dbvt.rs:155     RightChildOf(*mut DBVTInternal<B, BV>),
                                                   ^~~~~~~~~~~~~~~~~~~
src/partitioning/dbvt.rs:157:22: 157:41 warning: private type in exported type signature, #[warn(visible_private_types)] on by default
src/partitioning/dbvt.rs:157     LeftChildOf(*mut DBVTInternal<B, BV>),
                                                  ^~~~~~~~~~~~~~~~~~~
make -C lib/gl-rs
make lib -C deps/sax-rs
mkdir -p lib
rustc --out-dir=lib -O src/sax/lib.rs
rustc -L deps/sax-rs/lib src/gen/main.rs -o bin/glrsgen
src/gen/main.rs:65:42: 65:56 warning: use of deprecated item: use `Show` (`{}` format specifier), #[warn(deprecated)] on by default
src/gen/main.rs:65         Err(x) => fail!("Error: {}\n{}", x.to_err_msg(), usage("glrsgen", opts)),
                                                            ^~~~~~~~~~~~~~
note: in expansion of format_args!
<std macros>:24:9: 25:6 note: expansion site
<std macros>:1:1: 26:2 note: in expansion of fail!
src/gen/main.rs:65:19: 65:82 note: expansion site
bin/glrsgen --namespace gl --api gl --profile core --version 4.3 --xml deps/khronos-api/gl.xml   > src/gl.rs
rustc src/gl.rs -O --out-dir=lib
mkdir -p examples
make lib -C deps/glfw-rs
sh etc/link-rs.sh "-lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo " > src/link.rs
mkdir -p lib
rustc  --out-dir=lib -O src/glfw.rs
rustc -L deps/glfw-rs/lib -L lib --out-dir=examples src/examples/basic.rs
rustc -L deps/glfw-rs/lib -L lib --out-dir=examples src/examples/triangle.rs
rustdoc -o doc src/gl.rs
cd lib/rust-stb-image; ./configure
make clean -C lib/rust-stb-image
rm -f *.o *.a *.so *.dylib *.rlib *.dll *.dummy *-test
make -C lib/rust-stb-image
cc stb_image.c -o stb_image.o -c -fPIC
ar rcs libstb-image.a stb_image.o
rustc  lib.rs --out-dir .
stb_image.rs:28:5: 28:14 warning: code is never used: `read`, #[warn(dead_code)] on by default
stb_image.rs:28     read: *u8,
                    ^~~~~~~~~
stb_image.rs:29:5: 29:14 warning: code is never used: `skip`, #[warn(dead_code)] on by default
stb_image.rs:29     skip: *u8,
                    ^~~~~~~~~
stb_image.rs:30:5: 30:13 warning: code is never used: `eof`, #[warn(dead_code)] on by default
stb_image.rs:30     eof: *u8,
                    ^~~~~~~~
touch libstb-image.dummy
cd lib/rust-freetype; ./configure
make clean -C lib/rust-freetype
rm -f *.o *.a *.so *.dylib *.rlib *.dll *.dummy *-test
make -C lib/rust-freetype
rustc  freetype.rc --out-dir .
touch librustfreetype.dummy
kiss3d ➤ make                                                                                                                                     git:master
mkdir -p lib
rustc src/lib.rs --opt-level 3 --out-dir lib -Llib/glfw-rs/lib -Llib/gl-rs/lib -Llib/nalgebra/lib -Llib/rust-stb-image/ -Llib/rust-freetype/ -Llib/rust-ffmpeg/lib -Llib/ncollide/lib
cd lib/rust-ffmpeg; ./build.sh
Building src/avutil52 ...
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'lib/libavutil52-27cdbde1-0.0.dylib' 'lib/avutil52.o' '-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a' 'lib/avutil52.metadata.o' '-nodefaultlibs' '-Wl,-dead_strip' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lstd-59beb4f7-0.11.0-pre' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lsync-305341d2-0.11.0-pre' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lrustrt-d8560cb2-0.11.0-pre' '-L' 'lib' '-L' '/Users/bzabarauskas/dev/kiss3d/lib/rust-ffmpeg/.rust' '-L' '/Users/bzabarauskas/dev/kiss3d/lib/rust-ffmpeg' '-lavutil' '-lSystem' '-lpthread' '-lc' '-lm' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/libavutil52-27cdbde1-0.0.dylib' '-Wl,-rpath,@loader_path/../../../../../../../usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lcompiler-rt'
note: ld: warning: directory not found for option '-L/Users/bzabarauskas/dev/kiss3d/lib/rust-ffmpeg/.rust'
ld: library not found for -lavutil
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
make: *** [deps_recording] Error 1

Code compiles, but examples don't run with recent rust nightlies

When I build kiss3d using cargo build and then try to run any example (e.g `$ target/cube), I get the following error message:

dyld: Library not loaded: x86_64-apple-darwin/stage2/lib/rustlib/x86_64-apple-darwin/lib/libsemver-4e7c5e5c.dylib
  Referenced from: ~/kiss3d/target/cube
  Reason: image not found
Trace/BPT trap: 5

This is with the current Rust and Cargo nightly (pulled via rustup) on OS X 10.9.4, but happened with nightlies in the last few days as well.

I'm not sure where this problem originates, but I think this is the right place to report it, since other libs I've tested work.
If you think this is a bug in Rust, some help in how to go about producing a minimal example that reproduces this would be nice.

window.rs:327:38: 327:67 error: mismatched types: expected `*const std::os::raw::c_void`, found `*const libc::c_void`

When attempting to build the readme sample (and installing opengl freeglut3-dev, and randr xorg-dev libglu1-mesa-dev) I'm getting this:

Executing: cargo build 
   Compiling kiss3d v0.1.4 (https://github.com/sebcrozet/kiss3d#98f00870)
~/.cargo/git/checkouts/kiss3d-fdfcc5cc23d2dd9f/master/src/window/window.rs:327:38: 327:67 error: mismatched types:
 expected `*const std::os::raw::c_void`,
    found `*const libc::c_void`
(expected enum `std::os::raw::c_void`,
    found enum `libc::c_void`) [E0308]
~/.cargo/git/checkouts/kiss3d-fdfcc5cc23d2dd9f/master/src/window/window.rs:327         verify!(gl::load_with(|name| window.get_proc_address(name)));
                                                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~/.cargo/git/checkouts/kiss3d-fdfcc5cc23d2dd9f/master/src/window/window.rs:327:9: 327:70 note: in this expansion of verify! (defined in ~/.cargo/git/checkouts/kiss3d-fdfcc5cc23d2dd9f/master/src/error.rs)
~/.cargo/git/checkouts/kiss3d-fdfcc5cc23d2dd9f/master/src/window/window.rs:327:38: 327:67 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `kiss3d`.

The readme says that the latest nightlies of rust are required, but that was edited a long time ago so is that still necessary?

Reproducible builds

Hi! This issue is about getting Kiss to compile without worrying about Cargo dependencies. I have two suggestions:

  1. Use "rev" in the dependency sections of Cargo.toml to pull in the specific versions of dependencies that work with the current revision of Kiss.
  2. Tag stable revisions of Kiss with git tags. Use semantic versioning like v1.1.5.

Keep up the great work! 👍

Can't build with rust 0.10

Hi, I'm using the last stable rust release and getting this error after make:

> make
mkdir -p lib
rustc src/lib.rs --opt-level 3 --out-dir lib -Llib/glfw-rs/lib -Llib/gl-rs -Llib/nalgebra/lib -Llib/rust-stb-image/ -Llib/rust-freetype/
src/lib.rs:103:1: 103:19 error: can't find crate for `libc`
src/lib.rs:103 extern crate libc;
               ^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
make: *** [all] Error 101
> rustc -v
rustc 0.10 (46867cc 2014-04-02 16:59:39 -0700)
host: i686-apple-darwin

Does not compile with nightly

Fails to compile with this error:

   Compiling kiss3d v0.1.0 (https://github.com/sebcrozet/kiss3d#a97bfc10)
[...]/src/text/glyph.rs:7:1: 7:10 error: The attribute `packed` is currently unknown to the compiler and may have meaning added to it in the future
[...]/src/text/glyph.rs:7 #[packed]
                          ^~~~~~~~~
[...]/src/text/glyph.rs:7:1: 7:10 help: add #![feature(custom_attribute)] to the crate attributes to enable
error: aborting due to previous error
Could not compile `kiss3d`.

Allow choosing of sphere resolution

Right now, spheres have a "resolution" of 20 x 20 faces, which are often quite visible. Creating a sphere with more than 20x20 faces (say, 40x40) is a bit challenging:

let n1 = 40;
let n2 = 40;

let sphere_name=format!("sphere{}-{}", n1,n2);
let geom = kiss3d::procedural::unit_sphere(n1, n2);
let geom = kiss3d::resource::Mesh::from_mesh_desc(geom, false);
window.register_mesh(sphere_name, geom);
[...]
let diameter = 0.2;
let mut s : Object = window.add(sphere_name, diameter).unwrap();

I'm not sure how you do that while still caching the geometry...

maybe add a method to modify the "standard" sphere geometry? That would still require all spheres to have the same number of faces, but would allow that to be tunable.

Optimize video recording

The current implementation of the Recorder is very slow and spends most of its time flipping the opengl image and on sws_scale.

Mismatched types

Cannot compile:

+---- kiss3d/src/window/window.rs : 327 ----+
      =====>  error: mismatched types:
           >   expected `*const std::os::raw::c_void`,
           >      found `*const libc::c_void`
           >  (expected enum `std::os::raw::c_void`,
           >      found enum `libc::c_void`) [E0308]
 327 |>          verify!(gl::load_with(|name| window.get_proc_address(name)));
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rustc -V
rustc 1.6.0-nightly (bac2b13a5 2015-11-27)

More and/or better materials

The default material / lighting currently draws all materials as having a roughly "pastel" color, making them hard to distinguish.

Perhaps adding several types of default materials (e.g., "glassy", "metallic", "plastic") and/or ambient lighting would clear this up.

regenerate online documentation

At least the example in the online docs is out of date (extern crate native etc) and doesn't seem to match the doc comments in src/lib.rs

The nalgebra crate is causing issues with building the examples

I get the following error:

src/main.rs:17:37: 17:67 error: mismatched types:
     expected `&nalgebra::structs::vec::Vec3<f32>`,
        found `&nalgebra::structs::vec::Vec3<f32>`
    (expected struct `nalgebra::structs::vec::Vec3`,
        found a different struct `nalgebra::structs::vec::Vec3`) [E0308]
    src/main.rs:17     
    c.prepend_to_local_rotation(&Vec3::new(0.0f32, 0.014, 0.0));
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/main.rs:17:37: 17:67 help: run `rustc --explain E0308` to see a detailed explanation
    src/main.rs:17:37: 17:67 note: Perhaps two different versions of crate `nalgebra` are being used?
    src/main.rs:17       
  c.prepend_to_local_rotation(&Vec3::new(0.0f32, 0.014, 0.0));
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

When trying to build the example in the readme. I get similar errors with the other examples as well. I am not sure if this is my fault or a versioning issue.

Remove the dependency to ffmpeg.

ffmpeg is quite annoying to setup on some platform (like Ubuntu), and it is used by kiss3d for non-essential features (i-e video recording).

We might want to isolate non-essential features on dedicated crates (like kiss3d_recording).

Unable to run the front page example

When trying to fire up the first example got this:

$ cargo run
Compiling k3d_1 v0.1.0
src/main.rs:17:37: 17:67 error: mismatched types:
expected &nalgebra::structs::vec::Vec3<f32>,
found &nalgebra::structs::vec::Vec3<f32>
(expected struct nalgebra::structs::vec::Vec3,
found a different struct nalgebra::structs::vec::Vec3) [E0308]
src/main.rs:17 c.prepend_to_local_rotation(&Vec3::new(0.0f32, 0.014, 0.0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:17:37: 17:67 help: run rustc --explain E0308 to see a detailed explanation
error: aborting due to previous error
Could not compile k3d_1.

$ cargo --version
cargo 0.4.0-nightly (89435c4 2015-07-01) (built 2015-06-30)
$ rustc --version
rustc 1.3.0-nightly (bf3c979ec 2015-06-30)

the same issue for the stable channel

oculus rift support, aka multiple cameras

There is a single camera per window right now. I propose turning that into cameras, for the stereo side by side rendering use case that I'm interested in, but this also works for things like mini maps. What do you think?

note that for the OR (oculus rift) I also need to apply shaders to undo the pin-cushion effect, see: http://www.dgp.toronto.edu/~mccrae/projects/firebox/

I plan to try to fix this issue myself unless you were already planning to :)

Switch to Cargo?

Now that an alpha version of Cargo has been released as "ready to try out", do you think we could try and switch the build from a makefile to Cargo? Is that feasible?

At a minimum, it would be nice to have a "cargo.toml" so that packages depending on this one could use cargo.

ICE when compiling some example.

This seems to happen whenever the Object type or the widow.poll_events method are used by an example.

Example of ICE when compiling cube.rs:

examples/cube.rs:1:1: 1:1 error: internal compiler error: deref invoked on expr of illegal type std::rc::Rc<std::cell::RefCell<kiss3d::object::ObjectData>>
examples/cube.rs:1 extern crate native;
                   ^
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_LOG=std::rt::backtrace` for a backtrace
task 'rustc' failed at '~Any', /home/tortue/rust_compiler/src/libsyntax/diagnostic.rs:6

Relevant upstream issue: rust-lang/rust#13044

Error in glfw-rs

Compiling with rust-nightly on arch, make deps fails with a bunch of error: unresolved name slice::from_buf in your forked version of glfw-rs.

Orthographic Projection

It would be nice to have an orthographic projection option for the ArcBall and maybe FirstPerson cameras. Alternatively, if one could set a "zoom" as well as the "distance" for the ArcBall camera, that might also cover it, at least in the dist -> infinity and zoom -> infinity case, while also being more general.

Rustafarians lolwut

I wish we DID call ourselves that, but I've never seen that term used elsewhere.

panic!() from ArcBall camera when at extreme angle

Here's the trace, which points to an unwrap in ArcBall::update_projviews -> one of the matrix inversions appears to be failing. It generally happens when I am looking straight up, but it doesn't always happen :/

thread '<main>' panicked at 'called `Option::unwrap()` on a `None` value', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/option.rs:362
stack backtrace:
   1:        0x103229d5f - sys::backtrace::write::h5a94548fe691961bc2r
   2:        0x10322d664 - panicking::on_panic::hc33f9bf1349f5e0bLgw
   3:        0x103222465 - rt::unwind::begin_unwind_inner::hb24e48e8f7bb8bb0uYv
   4:        0x103222bdc - rt::unwind::begin_unwind_fmt::h6a45bf9659880992AXv
   5:        0x10322cf1c - rust_begin_unwind
   6:        0x10324d875 - panicking::panic_fmt::hbc8d57d5c8cf190bf3B
   7:        0x10324d054 - panicking::panic::ha4757516992ada06M1B
   8:        0x10306a31a - option::Option<T>::unwrap::h9497298474131113973
   9:        0x103068401 - camera::arc_ball::ArcBall::update_projviews::h05773ccf208a852aEic
  10:        0x1030681a5 - camera::arc_ball::ArcBall::set_yaw::h6da8fae3ffc92befZcc
  11:        0x102f84616 - glcmd::display::h922dbb93e7825692Uqb
  12:        0x102f8e5bb - main::h90c0a9a413b482f057b
  13:        0x10322f078 - rust_try_inner
  14:        0x10322f065 - rust_try
  15:        0x10322de70 - rt::lang_start::h8602e55e19d42be5gbw
  16:        0x102fa392e - main

Depend on glfw::WindowEvent or glfw

Right now, if you were to try and make examples/camera.rs into its own crate, you run into a dependency problem. camera.rs includes the line use glfw, which means that if it were in its own crate, it would need to depend on kiss3d and glfw. But not just any glfw: if you just put glfw = "*" in the Cargo.toml dependencies, you get a cryptic error expected enum 'glfw::WindowEvent', found a different enum 'glfw::WindowEvent').

This happens because one version of glfw is built for kiss3d based on git:[..]bjz/glfw-rs with default features turned off, and one version based on the crates.io glfw-rs version with default features turned on. Instead, you need to copy and paste the same glfw dependency from the kiss3d Cargo.toml section.

This is pretty confusing, and would be greatly simplified if kiss3d simply exported its reference to glfw::WindowEvent (i.e. pub use glfw::WindowEvent), or (if there are other instances like this, and you don't want to handle them specifically) its reference to glfw. See this post for more details; after thinking about it, I think the right solution is for kiss3d to export glfw symbols.

binary operations

Hello again.
I have the same issue what i had in nalgebra:
:1:1: 26:2 note: in expansion of fail!
src/scene/scene_node.rs:285:16: 285:82 note: expansion site
src/loader/obj.rs:24:11: 24:37 error: binary operation + cannot be applied to type &'static str
src/loader/obj.rs:24 fail!("At line " + line.to_str() + ": " + err)
I will fix this. I also have:
rc/window.rs:413:26: 413:42 error: mismatched types: expected ~str but found std::string::String (expected box but found struct std::string::String)
and same in multiple lines, also with type &str.
EDIT: to_owned() returns std::string::String

Example camera.rs fails to compile

make examples now fails on camera.rs, full error below.

This is with the newest nightly of rust, rustc 0.11.0-pre-nightly (3047614 2014-06-20 07:31:28 +0000), and updated kiss3d, commit 4631b7a.

The error looks like a rust compiler error, not a kiss3d one, but I couldn't reproduce it with regular structs / traits, only with the kiss3d example, so I don't know anymore which it is.


mkdir -p bin
rustc -Llib  -Llib/glfw-rs/lib -Llib/gl-rs/lib -Llib/nalgebra/lib -Llib/rust-stb-image/ -Llib/rust-freetype/ -Llib/rust-ffmpeg/lib -Llib/ncollide/lib --opt-level 3 --out-dir bin ./examples/add_remove.rs 
rustc -Llib  -Llib/glfw-rs/lib -Llib/gl-rs/lib -Llib/nalgebra/lib -Llib/rust-stb-image/ -Llib/rust-freetype/ -Llib/rust-ffmpeg/lib -Llib/ncollide/lib --opt-level 3 --out-dir bin ./examples/camera.rs 
examples/camera.rs:29:32: 29:40 error: `arc_ball` does not live long enough
examples/camera.rs:29         window.set_camera(&mut arc_ball as &mut Camera);
                                                     ^~~~~~~~
examples/camera.rs:20:46: 56:6 note: reference must be valid for an anonymous lifetime defined on the block at 20:45...
examples/camera.rs:20     Window::spawn("Kiss3d: camera", |window| {
examples/camera.rs:21         window.set_light(light::StickToCamera);
examples/camera.rs:22 
examples/camera.rs:23         // Replace the default arc-ball camera so that we can control it
examples/camera.rs:24         let eye              = Vec3::new(10.0f32, 10.0, 10.0);
examples/camera.rs:25         let at               = na::zero();
                      ...
examples/camera.rs:20:46: 56:6 note: ...but borrowed value is only valid for the block at 20:45
examples/camera.rs:20     Window::spawn("Kiss3d: camera", |window| {
examples/camera.rs:21         window.set_light(light::StickToCamera);
examples/camera.rs:22 
examples/camera.rs:23         // Replace the default arc-ball camera so that we can control it
examples/camera.rs:24         let eye              = Vec3::new(10.0f32, 10.0, 10.0);
examples/camera.rs:25         let at               = na::zero();
                      ...
examples/camera.rs:32:27: 45:14 error: `*arc_ball` does not live long enough
examples/camera.rs:32             w.poll_events(|w, event| {
examples/camera.rs:33                 match *event {
examples/camera.rs:34                     glfw::KeyEvent(key, _, glfw::Release, _) => {
examples/camera.rs:35                         if key == glfw::Key1 {
examples/camera.rs:36                             w.set_camera(&mut arc_ball as &mut Camera)
examples/camera.rs:37                         }
                      ...
note: reference must be valid for the static lifetime...
examples/camera.rs:31:9: 55:11 note: ...but borrowed value is only valid for the method call at 31:8
examples/camera.rs:31         window.render_loop(|w| {
examples/camera.rs:32             w.poll_events(|w, event| {
examples/camera.rs:33                 match *event {
examples/camera.rs:34                     glfw::KeyEvent(key, _, glfw::Release, _) => {
examples/camera.rs:35                         if key == glfw::Key1 {
examples/camera.rs:36                             w.set_camera(&mut arc_ball as &mut Camera)
                      ...
examples/camera.rs:32:27: 45:14 error: `*first_person` does not live long enough
examples/camera.rs:32             w.poll_events(|w, event| {
examples/camera.rs:33                 match *event {
examples/camera.rs:34                     glfw::KeyEvent(key, _, glfw::Release, _) => {
examples/camera.rs:35                         if key == glfw::Key1 {
examples/camera.rs:36                             w.set_camera(&mut arc_ball as &mut Camera)
examples/camera.rs:37                         }
                      ...
note: reference must be valid for the static lifetime...
examples/camera.rs:31:9: 55:11 note: ...but borrowed value is only valid for the method call at 31:8
examples/camera.rs:31         window.render_loop(|w| {
examples/camera.rs:32             w.poll_events(|w, event| {
examples/camera.rs:33                 match *event {
examples/camera.rs:34                     glfw::KeyEvent(key, _, glfw::Release, _) => {
examples/camera.rs:35                         if key == glfw::Key1 {
examples/camera.rs:36                             w.set_camera(&mut arc_ball as &mut Camera)
                      ...
error: aborting due to 3 previous errors
Makefile:24: recipe for target 'examples' failed
make: *** [examples] Error 101

compilation failed with rustc v0.13.0-nightly (42deaa5e4 2014-12-16 17:51:23 +0000)

Hi there,

I saw you fixed the build with rust v.0.13.0 already but it's failing again with the latest nightly build. Things are moving too fast in rust land 💨

Compilation of kiss3d master failed with:

kostas@cheeta ~/rustling> rustc --version
rustc 0.13.0-nightly (42deaa5e4 2014-12-16 17:51:23 +0000)
kostas@cheeta ~/rustling> cargo build
   Compiling kiss3d v0.1.0 (https://github.com/sebcrozet/kiss3d#d2c8653f)
src/resource/gpu_vector.rs:121:30: 121:34 error: cannot move out of dereference of `&mut`-pointer
src/resource/gpu_vector.rs:121             let buf_type   = self.buf_type;
                                                            ^~~~
src/resource/gpu_vector.rs:121:17: 121:25 note: attempting to move value to here
src/resource/gpu_vector.rs:121             let buf_type   = self.buf_type;
                                               ^~~~~~~~
src/resource/gpu_vector.rs:121:17: 121:25 help: to prevent the move, use `ref buf_type` or `ref mut buf_type` to capture value by reference
src/resource/gpu_vector.rs:121             let buf_type   = self.buf_type;
                                               ^~~~~~~~
src/resource/gpu_vector.rs:122:30: 122:34 error: cannot move out of dereference of `&mut`-pointer
src/resource/gpu_vector.rs:122             let alloc_type = self.alloc_type;
                                                            ^~~~
src/resource/gpu_vector.rs:122:17: 122:27 note: attempting to move value to here
src/resource/gpu_vector.rs:122             let alloc_type = self.alloc_type;
                                               ^~~~~~~~~~
src/resource/gpu_vector.rs:122:17: 122:27 help: to prevent the move, use `ref alloc_type` or `ref mut alloc_type` to capture value by reference
src/resource/gpu_vector.rs:122             let alloc_type = self.alloc_type;
                                               ^~~~~~~~~~
src/resource/gpu_vector.rs:139:74: 139:78 error: cannot move out of dereference of `&mut`-pointer
src/resource/gpu_vector.rs:139                         *len = update_buffer(d.as_slice(), *len, handle, self.buf_type, self.alloc_type)
                                                                                                        ^~~~
src/resource/gpu_vector.rs:139:89: 139:93 error: cannot move out of dereference of `&mut`-pointer
src/resource/gpu_vector.rs:139                         *len = update_buffer(d.as_slice(), *len, handle, self.buf_type, self.alloc_type)
                                                                                                                       ^~~~
src/resource/gpu_vector.rs:127:69: 127:77 error: cannot move out of captured outer variable in an `FnOnce` closure
src/resource/gpu_vector.rs:127                 (d.len(), GLHandle::new(upload_buffer(d.as_slice(), buf_type, alloc_type)))
                                                                                                   ^~~~~~~~
src/resource/gpu_vector.rs:127:79: 127:89 error: cannot move out of captured outer variable in an `FnOnce` closure
src/resource/gpu_vector.rs:127                 (d.len(), GLHandle::new(upload_buffer(d.as_slice(), buf_type, alloc_type)))
                                                                                                             ^~~~~~~~~~
src/resource/gpu_vector.rs:179:37: 179:41 error: cannot move out of dereference of `&mut`-pointer
src/resource/gpu_vector.rs:179             download_buffer(handle, self.buf_type, data.as_mut_slice());
                                                                   ^~~~
src/resource/mesh.rs:46:87: 46:95 error: use of moved value: `location`
src/resource/mesh.rs:46         let fs = Arc::new(RWLock::new(GPUVector::new(faces, BufferType::ElementArray, location)));
                                                                                                              ^~~~~~~~
src/resource/mesh.rs:45:81: 45:89 note: `location` moved here because it has type `resource::gpu_vector::AllocationType`, which is non-copyable
src/resource/mesh.rs:45         let cs = Arc::new(RWLock::new(GPUVector::new(coords, BufferType::Array, location)));
                                                                                                        ^~~~~~~~
src/resource/mesh.rs:47:82: 47:90 error: use of moved value: `location`
src/resource/mesh.rs:47         let ns = Arc::new(RWLock::new(GPUVector::new(normals, BufferType::Array, location)));
                                                                                                         ^~~~~~~~
src/resource/mesh.rs:45:81: 45:89 note: `location` moved here because it has type `resource::gpu_vector::AllocationType`, which is non-copyable
src/resource/mesh.rs:45         let cs = Arc::new(RWLock::new(GPUVector::new(coords, BufferType::Array, location)));
                                                                                                        ^~~~~~~~
src/resource/mesh.rs:48:78: 48:86 error: use of moved value: `location`
src/resource/mesh.rs:48         let us = Arc::new(RWLock::new(GPUVector::new(uvs, BufferType::Array, location)));
                                                                                                     ^~~~~~~~
src/resource/mesh.rs:45:81: 45:89 note: `location` moved here because it has type `resource::gpu_vector::AllocationType`, which is non-copyable
src/resource/mesh.rs:45         let cs = Arc::new(RWLock::new(GPUVector::new(coords, BufferType::Array, location)));
                                                                                                        ^~~~~~~~

Add fov() and set_fov() to ArcBall

ArcBall already has methods for pitch(), set_pitch(), yaw(), set_yaw(), dist(), and set_dist(); it seems like it should also have corresponding functions for fov() and set_fov().

ffmpeg dependency is outdated

Apparently, some commits are missing from the ffmpeg fork, which leads to a broken build (I get a build failure for avutil52).

For example, in the src directory, the last three commits are missing (see the history in the original repo and the fork).

If I replace the rust-ffmpeg directory in kiss3d/lib with a freshly pulled upstream version, the whole kiss3d build goes through.

(All on the newest rust nightly, i.e rustc 0.11.0-pre-nightly (e55f64f 2014-06-09 01:11:58 -0700).)

Simple device support

What about those devices supporting only OpenGL 1.x / GLES 1.1 ?

Any reason the default is always OpenGL 3 in these rust gl libs?

Reduce the use of @-boxes.

There are a lot of @-pointer on the engine. Some of them might be removed.
In particular, the World might not have to be inside of an @-box if we use std::cell::Cell on user-defined closures.

Color transparency

One awesome feature to have would be transparency for the color of objects. I know it probably isn't easy, but that's my one suggestion at the moment, as that would allow me to use this rather than my low-level GL code.

But otherwise, awesome project!

Move the `procedural` module to its own crate.

Because:

  • the procedural module does not depend on anything other than its own submodules.
  • some people might be interested in working on procedural generation without pulling the whole graphics engine.
  • as long as it is on Kiss3d, generation of 2d curves will not be implemented (because it does not make any sense).
  • procedural generation is a very cool topic, so this module might become pretty big in the end.

Use an iterator style instead of closures.

I think iterators are easier to use and to compose than closures.

For exemple, the main of the cube.rs demo would look like:

fn main() {
    let mut window = Window::new("Kiss3d: cube");
    let mut c      = window.add_cube(1.0, 1.0, 1.0);

    c.set_color(1.0, 0.0, 0.0);

    window.set_light(light::StickToCamera);

    for _ in window.iter() {
        c.prepend_to_local_rotation(&Vec3::new(0.0f32, 0.014, 0.0));
    }
}

And the main of event.rs would look like:

fn main() {
    let mut window = Window::new("Kiss3d: events");

    for frame in window.iter() {
        for mut event in frame.events().iter() {
            match event.value {
                glfw::KeyEvent(code, _, glfw::Press, _) => {
                    println!("You pressed the key with code: {:?}", code);
                    println!("Do not try to press escape: the event is inhibited!");
                    event.inhibited = true // override the default keyboard handler
                },
                glfw::KeyEvent(code, _, glfw::Release, _) => {
                    println!("You released the key with code: {:?}", code);
                    println!("Do not try to press escape: the event is inhibited!");
                    event.inhibited = true // override the default keyboard handler
                },
                glfw::MouseButtonEvent(button, glfw::Press, mods) => {
                    println!("You pressed the mouse button with code: {:?}", button);
                    println!("You pressed the mouse button with modifiers: {:?}", mods);
                    // dont override the default mouse handler
                },
                glfw::MouseButtonEvent(button, glfw::Release, mods) => {
                    println!("You released the mouse button with code: {:?}", button);
                    println!("You released the mouse button with modifiers: {:?}", mods);
                    // dont override the default mouse handler
                },
                glfw::CursorPosEvent(x, y) => {
                    println!("Cursor pos: ({} , {})", x, y);
                    // dont override the default mouse handler
                },
                glfw::ScrollEvent(xshift, yshift) => {
                    println!("Cursor pos: ({} , {})", xshift, yshift);
                    // dont override the default mouse handler
                },
                _ => { }
            }
        }
    }
} 

Unexpected internal compiler error fixing Any

I just tried fixing the absence of Any from the prelude in the latest Rust compiler like so:

diff --git a/src/object.rs b/src/object.rs
index b76bcbf..3c2dd60 100644
--- a/src/object.rs
+++ b/src/object.rs
@@ -2,6 +2,7 @@

 use std::cell::RefCell;
 use std::rc::Rc;
+use std::any::Any;
 use gl::types::*;
 use nalgebra::na::{Mat3, Vec2, Vec3, Iso3, Rotation, Rotate, Translation, Transformation};
 use nalgebra::na;

This caused an unexpected compiler error:

error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
Ok(task 'rustc' failed at 'index out of bounds: the len is 0 but the index is 0', /build/rust-git/src/rust/src/librustc/lib.rs:1
)

Will report upstream as well, but I thought raising an issue here is probably also a good idea, since it effectively makes compiling kiss3d impossible.

Black screen on mac OS X.

This was originaly reported by @jmgrosen on IRC and I can reproduce the bug. It looks like the whole window is frozen.

I’ll investigate this soon.

Remove event handling from the cameras.

At the moment event handling is exclusively done by the active camera. This is not very modular since event handlers could be stand-alone controllers that modify some scene node properties.

Add ffmpeg compatibility / example

It would be neat to be able to export a video. I have no idea how challenging that would be, but if its not too difficult, could that be added (along with an example)?

Can't build on Ubuntu

The library can't build on Ubuntu because of the lack of ffmpeg's swresample on this system.

Consider stealing ideas from Shoes

Hey there!

Not so much a bug as a suggestion, feel free to close.

I maintain a desktop GUI library for Ruby called Shoes: http://shoesrb.com

Your hello world reminded me ofnit a bit, lambas for certain things... It also intends to be easy to use, and i thought it might provide you with some inspiration.

🤘 on!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.