Jump to content

Real-time 3D rendering programming help


twiz
 Share

Recommended Posts

Hi fellas, I'm not really sure where to put this(maybe in the 3D forum?) but it's pretty OT so I'll stick it here.

Background:

I'm building a robot for work, and I would like to implement a 3D-display window on the controlling computer that shows the tool's current position and orientation. The tool has the capability/sensors to determine it's XYZ coordinates relative to a reference point as well as pitch/yaw/roll. I can find some info/videos online of people doing somewhat similar things with devices with similar capabilities (either Arduino-based accelerometer/magnetometer/gyroscope boards or with a Wiimote or whatever). However, all the ones I have seen are only using the Pitch/Yaw/Roll to control a 3D box that pivots around the origin, and I can't find much info on the software they're running/actual code they've written.

Goal:

I want a piece of software that will be able to import a model drawn in 3D CAD software(I can model in pretty much anything, and probably export to anything else!) for both the robot itself AND it's environment. I then want to display the tool model in it's correct position and orientation relative to the environment model, in real-time. I can handle acquiring and processing the data. It doesn't need too look pretty - solid shaded colors would be fine for the models(the robot is blue and the environment is beige or something). We just need to see where the robot is without being able to actually SEE it. A translucent environment model would be nice, but perhaps not necessary.

I have read a bit about OpenGL, and it seems like the way to go... but I just know nothing about it, and am having a difficult time of figuring out even where to begin. There has to be a standard method for loading in a model of a certain format, right? Performing transforms(position, P/Y/R)? Real-time user interface(rotate, zoom,pan)?

Basically:

I want a "perspective window" from any 3D development software, but updated real-time with data received from an outside source.

A caveat: This will likely end up as an embedded solution in a Unix platform, since the same program will be controlling the robot as well, and therefore it needs to be a real-time application.

So, any advice, links, etc? Am I just simply in way over my head? Should I just hire someone? Anyone need a job? :v

Seriously, I can definitely hire someone to do this, but I like learning this stuff too. I would like to know the guts of it, so when I need to make a change for a future robot or if something bugs out, I can do the modifications.

Link to comment
Share on other sites

The robots they are using in Japan to get more information of the nuclear leak are using a (standard games console), unreal might be a good choice since the sdk is free.

Printing out technical info from an engine isn't that hard :)

Link to comment
Share on other sites

since you are talking of unixoid target systems i would go for some open source software instead of proprietary stuff. i once worked with openscenegraph which has a good set of features. check it out: http://www.openscenegraph.org/projects/osg

the rendering is based on opengl and it supports many different unix systems.

probably much more fitting your case than the unreal engine (which is clearly targeted for game development and not pure visualisation).

Link to comment
Share on other sites

since you are talking of unixoid target systems i would go for some open source software instead of proprietary stuff. i once worked with openscenegraph which has a good set of features. check it out: http://www.openscenegraph.org/projects/osg

the rendering is based on opengl and it supports many different unix systems.

probably much more fitting your case than the unreal engine (which is clearly targeted for game development and not pure visualisation).

I will very much agree with Hessi here, OpenGL, most likely with OSG, is the way to go for this task. Trying to use a game engine such as Unreal is theoretically possible but it will involve so much more unnecessary hassle.

Link to comment
Share on other sites

Thanks guys! I was definitely leaning towards open-source stuff. I've looked at Ogre3D, and it didn't seem too far over my head(used C++ and openGL) and is open source.. but that looks possibly more simple and straightforward. I just got C++ for dummies, time to figure out what I've forgotten in the 8 years since I last programmed :-D

I thought about using some "real" game engines, but I get the impression that I would spend more time trying to strip away unnecessary stuff than programming :D The most complex thing I'd need it to handle is a transparent surface and smooth-shading... decade+ old technology here.

I'm going to go do some reading and I'll let you know how it works out! Been playing with the sensor a bit today, it's really bad-ass... Maybe I'll post a video online if I get it working :D

Link to comment
Share on other sites

Thanks for the help guys, I'm making some progress! I'll post some pics or something tomorrow, as long as you keep it hush-hush :-D Don't want to get into NDA troubles...

Right now I've got my models from solidworks into blender via .stl, then applying material in blender(just solid colors/transparency - all I need!), and exporting those into .mesh & .material for Ogre3D to play with. Imported my models in Ogre and have it so I can move around the robot in the correct fashion in relation to the vessel, as well as move parts of the robot in relation to the robot. Right now it's just controlled with the keyboard, my friend is working on getting the data from the sensors into C++ via USB serial so we can have the robot controlled by the sensors instead. Camera position is currently controlled by WASD/mouse, and I think I'll keep it that way. I thought about having the camera follow the robot, 3rd person style, but this will allow us to get whatever perspective we need.

It's working fairly well, I was concerned about the polygon count, but I guess I'm behind the times with what is acceptable. Right now I'm at ~180,000 polygons, about 70,000 of those are transparent. It runs at ~250fps in OpenGL and ~350fps in DirectX, also in debug mode. I'll have to see what it runs at in regular mode on a less-beastly computer. I'll bring my old cheapo laptop to work tomorrow and give it a run!

Now I need to figure out how to pop up a dialog box or something so we can manually enter values for the robot, like set it's current known position for it to move off of... but for now, we have progress! :v

Link to comment
Share on other sites

Hmmm wish I checked this earlier! Messed with cegui all day, then quickgui, then mygui. Could get none working. Just got rid of everything related to Ogre3D and all the damn GUIs. Going to start fresh, and I'll try betaGUI this time!

Using VS2010 is a huge pain in the ass, as everything out there is for VS2008, and nothing ever converts properly. I'm getting VS2008 right now.

Edit : unfortunately there is almost no documentation on betaGUI since it's a dead project for several years now... I just don't know enough to get it working from the documentation I can find and no examples. I'm working on getting quickGUI working now... hopefully with VS2008 it won't be such an issue.

Link to comment
Share on other sites

Got VS2008 and I'm still tryin to get CEGUI to work. Going very slowly through the tutorials, hopefully I'll have it working soon.

Here's what I've got so far. The transparent red thing is a reactor vessel, the little blue guy is our robot, the green thing on the front is supposed to be a representation of our sensors. The robot can move around the surface of the vessel, and the green thing moves in relation to the robot. It's pretty nifty :)

basictutorial4201104291.jpg

basictutorial4201104291.jpg

basictutorial4201104291.jpg

The horizontal rings in the vessel represent the welds we inspect.

Link to comment
Share on other sites

Hmm, what do you mean by that? Like in the second shot, it's difficult to tell where the robot is in relation to the vessel? The robot does look like it's just floating there. Hmm :interseting:

I am going to be adding in XYZ planes marked for their angle (0, 90, 180, 270), that was my idea to give an idea of where it is. Once I get the friggin GUI working it'll have angle/depth readouts indicating where the bot is in a HUD.

I could texture it.. but the vessel is basically just a big hunk of stainless steel. Not much feature to it. Unsure of how it'd look being transparent too? And the robot is just.. an anodized blue box :derp:

Link to comment
Share on other sites

i meant the first screenshot. there is so much transparency overlaying that it makes it hard to figure out the perspective. but please don't take me too serious. maybe that is just me and the fact, that i am looking at a still image.

btw: you don't need textures on those objects. simplicity is much more appropriate in your use case!

Link to comment
Share on other sites

I appreciate the feedback, I have to make this as easy as possible to use and understand! I think the XYZ planes will help with the perspective.

I just got CEGUI working. It is way overkill for what I'm doing, which unfortunately means it's way more complex than necessary (for me). But I've got my GUI designed, I just need to finish transferring it from photoshop concept to GUI reality... and then integrate it with the 3D rendering. Tomorrow is going to be a long day :XD: Hopefully I'll have some shots of the GUI with the rendering and the XYZ planes soon for more critiques :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • MapCore on Discord

  • Our picks

    • Post in [UE4] Island Environment [W.I.P]
      I've release the project on the ue4's Marketplace. LINK

      There's also a playable demo that you can check out here: DEMO

      This was my most time consuming project that I've started back in 2018, but then scrapped and returned to it in 2021.

      It took about 8 months to complete and was a great learning experience for me. 





       

       

       
×
×
  • Create New...