ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-17-2008
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default Need explanation of Flexsim drawing commands

Does anybody have a good summarization of Flexsim drawing commands? It seems there are different types of drawing commands. Some are using view as a parameter, e.g. the drawtext command. Some do not have veiw as a parameter, e.g. the drawcube command. Sometimes the drawing commands are embed in opengl commands glBegin and glEnd. Sometimes they are not. I am confused. I just started to learn opengl, mainly for custom draws in Flexsim. Since there is little information in Flexsim help on custom draws, it would be very helpful if someone can give me some hints here. Thanks for the help!
__________________
Best,
Alan
  #2  
Old 04-17-2008
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default An explanation of Flexsim draw commands and OpenGL

I'm sorry to hear this is confusing. I spent a fair amount of time before the v4.3 release organizing and providing better documentation for all the drawing commands including the new flexscript available OpenGL commands. I deprecated all the older duplicate commands that I thought were causing confusion as well.

Actually in reading your post, it sounds like you have a pretty good handle on what the issues are. Just about any of the commands that draw something that do not start with gl___ are going to be embedded inside of a glBegin and glEnd behind the scenes. Of course those commands that allow you to specify a color and/or texture for the shape it draws are most definitely going to require this.

If you want to write the most efficient draw code that you get to have the ultimate control of, then use all OpenGL commands. We're lucky we get to use them in flexscript now. It makes it easier to experiment and see the effects of our code immediately in the view window!

It's not hard to learn OpenGL, all you really need to know is that it works on the concept of "states". In other words, the OpenGL draw environment is always in a given draw state (or mode) that you can manipulate with commands, and then every draw type command written afterwards is going to draw based on the current state. There are commands to change the color state, the coordinate system, the lighting, etc..

Next, just read through the Flexsim command documentation for all the gl__ type commands and you will get a good idea of how it works because several of the commands have nice examples associated with them. I included the most information regarding drawing in OpenGL space in the command documentation of the glVertex3d command (incidentally, the 3d at the end of the word refers to 3 double precision values and not 3 dimensions - you might also come across an f which stands for floating point precision value).

I've also attached a short Power Point Presentation that AJ Bobo prepared a long time ago for a FlexSimposium conference session where he taught the basics of OpenGL. You might find it helpful, just keep in mind things might have changed slightly since then.
Attached Files
File Type: zip Intro to OpenGL.zip (233.8 KB, 483 views)
The Following 2 Users Say Thank You to Cliff King For This Useful Post:
arunkrmahadeva (01-29-2014)
  #3  
Old 04-17-2008
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Hi Cliff,

I did not mean your work is not good. Actually, I find that I was looking at the old 4.1 (maybe 4.30) document yesterday when I was in my home. And I was wondering why gl command is in under the math group. And this morning when I am in the office having the 4.32. I see the difference in the help document. It is much better and having examples. I will update the Flexsim version on my home computer. Perhaps the best way to learn is to play with those commands in Flexsim through examples.

Thanks for the attached OpenGL slides. I appreciate your help.
__________________
Best,
Alan


Thread Thread Starter Forum Replies Last Post
What about the file read commands? AlanZhang Gripes and Goodies 0 02-08-2008 05:17 PM
Explanation of empirical, cempirical and dempirical distributions Cliff King Q&A 0 01-04-2008 12:12 PM
How to prepare an AutoCAD drawing for Flexsim import. Regan Blackett Tips and Tricks 1 11-07-2007 07:08 PM
New custom commands in Downloads link Cliff King Q&A 0 09-24-2007 05:46 PM
Can the new object like followed explanation be created? syseo Q&A 0 09-23-2007 06:15 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.